Changeset 50988d1 for protocols/purple
- Timestamp:
- 2016-10-31T00:38:32Z (8 years ago)
- Branches:
- master
- Children:
- fecdd71
- Parents:
- c94e208
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/purple/purple.c
rc94e208 r50988d1 101 101 } 102 102 103 static char *purple_get_account_prpl_id(account_t *acc) 104 { 105 /* "oscar" is how non-purple bitlbee calls it, 106 * and it might be icq or aim, depending on the username */ 107 if (g_strcmp0(acc->prpl->name, "oscar") == 0) { 108 return (g_ascii_isdigit(acc->user[0])) ? "prpl-icq" : "prpl-aim"; 109 } 110 111 return acc->prpl->data; 112 } 113 103 114 static void purple_init(account_t *acc) 104 115 { 105 PurplePlugin *prpl = purple_plugins_find_with_id((char *) acc->prpl->data); 116 char *prpl_id = purple_get_account_prpl_id(acc); 117 PurplePlugin *prpl = purple_plugins_find_with_id(prpl_id); 106 118 PurplePluginProtocolInfo *pi = prpl->info->extra_info; 107 119 PurpleAccount *pa; … … 269 281 /* Go through all away states to figure out if away/status messages 270 282 are possible. */ 271 pa = purple_account_new(acc->user, (char *) acc->prpl->data);283 pa = purple_account_new(acc->user, prpl_id); 272 284 for (st = purple_account_get_status_types(pa); st; st = st->next) { 273 285 PurpleStatusPrimitive prim = purple_status_type_get_primitive(st->data); … … 347 359 348 360 ic->proto_data = pd = g_new0(struct purple_data, 1); 349 pd->account = purple_account_new(acc->user, (char *) acc->prpl->data);361 pd->account = purple_account_new(acc->user, purple_get_account_prpl_id(acc)); 350 362 pd->input_requests = g_hash_table_new_full(g_direct_hash, g_direct_equal, 351 363 NULL, g_free); … … 1709 1721 ret = g_memdup(&funcs, sizeof(funcs)); 1710 1722 ret->name = "oscar"; 1711 ret->data = prot->info->id; 1723 /* purple_get_account_prpl_id() determines the actual protocol ID (icq/aim) */ 1724 ret->data = NULL; 1712 1725 register_protocol(ret); 1713 1726 }
Note: See TracChangeset
for help on using the changeset viewer.