Changeset 06eef80 for root_commands.c


Ignore:
Timestamp:
2013-02-21T14:03:15Z (11 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.