Changeset fcb2c2e for protocols


Ignore:
Timestamp:
2015-01-26T02:43:34Z (10 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
11e7828
Parents:
be1efa3
git-author:
dequis <dx@…> (18-01-15 16:15:40)
git-committer:
dequis <dx@…> (26-01-15 02:43:34)
Message:

jabber: Account-wide display_name setting, for groupchats

This sets the default value of 'nick' for newly created groupchats.
There is no way to set an account-wide nick.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    rbe1efa3 rfcb2c2e  
    6363        s = set_add( &acc->set, "oauth", "false", set_eval_oauth, acc );
    6464
     65        s = set_add( &acc->set, "display_name", NULL, NULL, acc );
     66       
    6567        g_snprintf( str, sizeof( str ), "%d", jabber_port_list[0] );
    6668        s = set_add( &acc->set, "port", str, set_eval_int, acc );
     
    474476{
    475477        struct jabber_data *jd = ic->proto_data;
    476        
     478        char *final_nick;
     479       
     480        /* Ignore the passed nick parameter if we have our own default */
     481        if ( !( final_nick = set_getstr( sets, "nick" ) ) &&
     482             !( final_nick = set_getstr( &ic->acc->set, "display_name" ) ) ) {
     483                /* Well, whatever, actually use the provided default, then */
     484                final_nick = (char *) nick;
     485        }
     486
    477487        if( strchr( room, '@' ) == NULL )
    478488                imcb_error( ic, "%s is not a valid Jabber room name. Maybe you mean %s@conference.%s?",
     
    481491                imcb_error( ic, "Already present in chat `%s'", room );
    482492        else
    483                 return jabber_chat_join( ic, room, nick, set_getstr( sets, "password" ) );
     493                return jabber_chat_join( ic, room, final_nick, set_getstr( sets, "password" ) );
    484494       
    485495        return NULL;
Note: See TracChangeset for help on using the changeset viewer.