Changeset 06eef80


Ignore:
Timestamp:
2013-02-21T14:03:15Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
a5c6ebd
Parents:
12f500f
Message:

For the lazy among us: When adding a Jabber/MSN contact within the same
domain like you, you can omit the domain name.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • protocols/account.h

    r12f500f r06eef80  
    7070        ACC_FLAG_AWAY_MESSAGE = 0x01,   /* Supports away messages instead of just states. */
    7171        ACC_FLAG_STATUS_MESSAGE = 0x02, /* Supports status messages (without being away). */
     72        ACC_FLAG_HANDLE_DOMAINS = 0x04, /* Contact handles need a domain portion. */
    7273} account_flag_t;
    7374
  • protocols/jabber/jabber.c

    r12f500f r06eef80  
    9696        s->flags |= ACC_SET_OFFLINE_ONLY;
    9797       
    98         acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
     98        acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE |
     99                      ACC_FLAG_HANDLE_DOMAINS;
    99100}
    100101
  • protocols/jabber/jabber.h

    r12f500f r06eef80  
    196196};
    197197
    198 #define JABBER_XMLCONSOLE_HANDLE "xmlconsole"
     198#define JABBER_XMLCONSOLE_HANDLE "_xmlconsole"
    199199#define JABBER_OAUTH_HANDLE "jabber_oauth"
    200200
  • protocols/msn/msn.c

    r12f500f r06eef80  
    4444        set_add( &acc->set, "switchboard_keepalives", "false", set_eval_bool, acc );
    4545       
    46         acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
     46        acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE |
     47                      ACC_FLAG_HANDLE_DOMAINS;
    4748}
    4849
  • root_commands.c

    r12f500f r06eef80  
    680680        account_t *a;
    681681        int add_on_server = 1;
     682        char *handle = NULL, *s;
    682683       
    683684        if( g_strcasecmp( cmd[1], "-tmp" ) == 0 )
     
    715716                        nick_set_raw( a, cmd[2], cmd[3] );
    716717                }
     718        }
     719       
     720        if( ( a->flags & ACC_FLAG_HANDLE_DOMAINS ) && cmd[2][0] != '_' &&
     721            ( !( s = strchr( cmd[2], '@' ) ) || s[1] == '\0' ) )
     722        {
     723                /* If there's no @ or it's the last char, append the user's
     724                   domain name now. Exclude handles starting with a _ so
     725                   adding _xmlconsole will keep working. */
     726                if( s )
     727                        *s = '\0';
     728                if( ( s = strchr( a->user, '@' ) ) )
     729                        cmd[2] = handle = g_strconcat( cmd[2], s, NULL );
    717730        }
    718731       
     
    746759        }
    747760       
     761        g_free( handle );
    748762}
    749763
Note: See TracChangeset for help on using the changeset viewer.