src/server.c

changeset 8562
7e73676d1772
parent 8413
92b9a04b2fd6
child 8568
66907b37ce85
equal deleted inserted replaced
8561:fb105b6434ef 8562:7e73676d1772
712 712
713 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->join_chat) 713 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->join_chat)
714 prpl_info->join_chat(g, data); 714 prpl_info->join_chat(g, data);
715 } 715 }
716 716
717
718 void serv_reject_chat(GaimConnection *g, GHashTable *data)
719 {
720 GaimPluginProtocolInfo *prpl_info = NULL;
721
722 if (g != NULL && g->prpl != NULL)
723 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);
724
725 if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->reject_chat)
726 prpl_info->reject_chat(g, data);
727 }
728
717 void serv_chat_invite(GaimConnection *g, int id, const char *message, const char *name) 729 void serv_chat_invite(GaimConnection *g, int id, const char *message, const char *name)
718 { 730 {
719 GaimPluginProtocolInfo *prpl_info = NULL; 731 GaimPluginProtocolInfo *prpl_info = NULL;
720 GaimConversation *conv; 732 GaimConversation *conv;
721 char *buffy = message && *message ? g_strdup(message) : NULL; 733 char *buffy = message && *message ? g_strdup(message) : NULL;
1321 if (cid->components) 1333 if (cid->components)
1322 g_hash_table_destroy(cid->components); 1334 g_hash_table_destroy(cid->components);
1323 g_free(cid); 1335 g_free(cid);
1324 } 1336 }
1325 1337
1338
1339 static void chat_invite_reject(struct chat_invite_data *cid)
1340 {
1341 serv_reject_chat(cid->gc, cid->components);
1342 chat_invite_data_free(cid);
1343 }
1344
1345
1326 static void chat_invite_accept(struct chat_invite_data *cid) 1346 static void chat_invite_accept(struct chat_invite_data *cid)
1327 { 1347 {
1328 serv_join_chat(cid->gc, cid->components); 1348 serv_join_chat(cid->gc, cid->components);
1329
1330 chat_invite_data_free(cid); 1349 chat_invite_data_free(cid);
1331 } 1350 }
1332 1351
1333 1352
1334 1353
1357 cid->components = data; 1376 cid->components = data;
1358 1377
1359 gaim_request_accept_cancel(gc, NULL, _("Accept chat invitation?"), 1378 gaim_request_accept_cancel(gc, NULL, _("Accept chat invitation?"),
1360 buf2, 0, cid, 1379 buf2, 0, cid,
1361 G_CALLBACK(chat_invite_accept), 1380 G_CALLBACK(chat_invite_accept),
1362 G_CALLBACK(chat_invite_data_free)); 1381 G_CALLBACK(chat_invite_reject));
1363 } 1382 }
1364 1383
1365 GaimConversation *serv_got_joined_chat(GaimConnection *gc, 1384 GaimConversation *serv_got_joined_chat(GaimConnection *gc,
1366 int id, const char *name) 1385 int id, const char *name)
1367 { 1386 {

mercurial