Changeset 59ccef5
- Timestamp:
- 2016-12-26T00:20:09Z (8 years ago)
- Branches:
- master
- Children:
- 9c7ef22
- Parents:
- 6d212f4
- git-author:
- dequis <dx@…> (26-12-16 00:13:57)
- git-committer:
- dequis <dx@…> (26-12-16 00:20:09)
- Location:
- protocols/purple
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/purple/bpurple.h
r6d212f4 r59ccef5 6 6 7 7 #define PURPLE_REQUEST_HANDLE "purple_request" 8 9 #define PURPLE_OPT_SHOULD_SET_NICK 1 8 10 9 11 struct purple_data … … 15 17 char *chat_list_server; 16 18 GSList *filetransfers; 19 20 int flags; 17 21 }; 18 22 -
protocols/purple/purple.c
r6d212f4 r59ccef5 114 114 } 115 115 116 static gboolean purple_account_should_set_nick(account_t *acc) 117 { 118 /* whitelist of protocols that tend to have numeric or meaningless usernames, and should 119 * always offer the 'alias' as a nick. this is just so that users don't have to do 120 * 'account whatever set nick_format %full_name' 121 */ 122 char *whitelist[] = { 123 "prpl-hangouts", 124 "prpl-eionrobb-funyahoo-plusplus", 125 "prpl-icq", 126 NULL, 127 }; 128 char **p; 129 130 for (p = whitelist; *p; p++) { 131 if (g_strcmp0(acc->prpl->data, *p) == 0) { 132 return TRUE; 133 } 134 } 135 136 return FALSE; 137 } 138 116 139 static void purple_init(account_t *acc) 117 140 { … … 367 390 purple_account_set_password(pd->account, acc->pass); 368 391 purple_sync_settings(acc, pd->account); 392 393 if (purple_account_should_set_nick(acc)) { 394 pd->flags = PURPLE_OPT_SHOULD_SET_NICK; 395 } 369 396 370 397 purple_account_set_enabled(pd->account, "BitlBee", TRUE); … … 903 930 PurpleGroup *group = purple_buddy_get_group(bud); 904 931 struct im_connection *ic = purple_ic_by_pa(bud->account); 932 struct purple_data *pd = ic->proto_data; 905 933 PurpleStatus *as; 906 934 int flags = 0; 935 char *alias = NULL; 907 936 908 937 if (ic == NULL) { … … 910 939 } 911 940 912 if (bud->server_alias) { 913 imcb_rename_buddy(ic, bud->name, bud->server_alias); 914 } else if (bud->alias) { 915 imcb_rename_buddy(ic, bud->name, bud->alias); 941 alias = bud->server_alias ? : bud->alias; 942 943 if (alias) { 944 imcb_rename_buddy(ic, bud->name, alias); 945 if (pd->flags & PURPLE_OPT_SHOULD_SET_NICK) { 946 imcb_buddy_nick_change(ic, bud->name, alias); 947 } 916 948 } 917 949
Note: See TracChangeset
for help on using the changeset viewer.