Changeset fcb2c2e


Ignore:
Timestamp:
2015-01-26T02:43:34Z (9 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.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/user-guide/commands.xml

    rbe1efa3 rfcb2c2e  
    888888                <description>
    889889                        <para>
    890                                 Currently only available for MSN connections. This setting allows you to read and change your "friendly name" for this connection. Since this is a server-side setting, it can't be changed when the account is off-line.
     890                                Currently only available for MSN connections, and for jabber groupchats.
     891                        </para>
     892                        <para>
     893                                For MSN: This setting allows you to read and change your "friendly name" for this connection. Since this is a server-side setting, it can't be changed when the account is off-line.
     894                        </para>
     895                        <para>
     896                                For jabber groupchats: this sets the default value of 'nick' for newly created groupchats. There is no way to set an account-wide nick like MSN.
    891897                        </para>
    892898                </description>
  • 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.