comparison src/server.c @ 8562:e3c059c3d92d

[gaim-migrate @ 9306] " This patch adds a call-back slot to the GaimPluginProtocolInfo structure which allows a prpl to receive notification when a chat invitation has been rejected by the local user. The patch modifies server.c to trigger the call-back, and adds NULL entries into the existing protocols to make them match the updated ABI. This is necessary for a protocol plugin which I have written, as the protocol needs to take action in the event of a conference rejection. It is my understanding that the Yahoo prpl may also benefit from this patch (it's supposed to be sending the rejection upstream to the server too, as I understand it)" --Christopher (siege) O'Brien committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 02 Apr 2004 06:54:52 +0000
parents f5b0e1a4b0c7
children 88988327a4e0
comparison
equal deleted inserted replaced
8561:2d4ccd94e298 8562:e3c059c3d92d
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 {