comparison libpurple/server.c @ 23169:ff8ec3d58367

Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and chat-invite-blocked signals for blocked im messages and blocked chat invites. Closes #1062.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 23 May 2008 02:23:07 +0000
parents 591ef3693345
children 5e6392e93ce9 ff29208e03ef
comparison
equal deleted inserted replaced
23168:d7e66b6137f9 23169:ff8ec3d58367
657 657
658 account = purple_connection_get_account(gc); 658 account = purple_connection_get_account(gc);
659 659
660 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) { 660 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) {
661 /* protocol does not support privacy, handle it ourselves */ 661 /* protocol does not support privacy, handle it ourselves */
662 if (!purple_privacy_check(account, who)) 662 if (!purple_privacy_check(account, who)) {
663 purple_signal_emit(purple_conversations_get_handle(), "blocked-im-msg",
664 account, who, msg, flags, (unsigned int)mtime);
663 return; 665 return;
666 }
664 } 667 }
665 668
666 /* 669 /*
667 * We should update the conversation window buttons and menu, 670 * We should update the conversation window buttons and menu,
668 * if it exists. 671 * if it exists.
877 int plugin_return; 880 int plugin_return;
878 881
879 account = purple_connection_get_account(gc); 882 account = purple_connection_get_account(gc);
880 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) { 883 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) {
881 /* protocol does not support privacy, handle it ourselves */ 884 /* protocol does not support privacy, handle it ourselves */
882 if (!purple_privacy_check(account, who)) 885 if (!purple_privacy_check(account, who)) {
886 purple_signal_emit(purple_conversations_get_handle(), "chat-invite-blocked",
887 account, who, name, message, data);
883 return; 888 return;
889 }
884 } 890 }
885 891
886 plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1( 892 plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1(
887 purple_conversations_get_handle(), 893 purple_conversations_get_handle(),
888 "chat-invited", account, who, name, message, data)); 894 "chat-invited", account, who, name, message, data));