Mercurial > pidgin
comparison src/server.c @ 12849:c0fbdea8828b
[gaim-migrate @ 15199]
SF Patch #1230429 from Jean-Yves Lefort
"Block instant messages in core if a prpl does not
support privacy."
I modified this to use the gaim_privacy_check() Sadrul added a while back. I
also cleaned up the loose end, rather than leaving a function that always
returned TRUE. Finally, I added the same check to the chat invite handler.
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Thu, 12 Jan 2006 06:44:23 +0000 |
| parents | eda1572c788b |
| children | 7dc00a9dfba5 |
comparison
equal
deleted
inserted
replaced
| 12848:d26e3314c650 | 12849:c0fbdea8828b |
|---|---|
| 25 #include "conversation.h" | 25 #include "conversation.h" |
| 26 #include "debug.h" | 26 #include "debug.h" |
| 27 #include "log.h" | 27 #include "log.h" |
| 28 #include "notify.h" | 28 #include "notify.h" |
| 29 #include "prefs.h" | 29 #include "prefs.h" |
| 30 #include "privacy.h" | |
| 30 #include "prpl.h" | 31 #include "prpl.h" |
| 31 #include "request.h" | 32 #include "request.h" |
| 32 #include "signals.h" | 33 #include "signals.h" |
| 33 #include "server.h" | 34 #include "server.h" |
| 34 #include "status.h" | 35 #include "status.h" |
| 438 int plugin_return; | 439 int plugin_return; |
| 439 | 440 |
| 440 g_return_if_fail(msg != NULL); | 441 g_return_if_fail(msg != NULL); |
| 441 | 442 |
| 442 account = gaim_connection_get_account(gc); | 443 account = gaim_connection_get_account(gc); |
| 444 | |
| 445 if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->set_permit_deny == NULL) { | |
| 446 /* protocol does not support privacy, handle it ourselves */ | |
| 447 if (!gaim_privacy_check(account, who)) | |
| 448 return; | |
| 449 } | |
| 450 | |
| 443 presence = gaim_account_get_presence(account); | 451 presence = gaim_account_get_presence(account); |
| 444 | 452 |
| 445 /* | 453 /* |
| 446 * We should update the conversation window buttons and menu, | 454 * We should update the conversation window buttons and menu, |
| 447 * if it exists. | 455 * if it exists. |
| 667 char buf2[BUF_LONG]; | 675 char buf2[BUF_LONG]; |
| 668 struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1); | 676 struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1); |
| 669 int plugin_return; | 677 int plugin_return; |
| 670 | 678 |
| 671 account = gaim_connection_get_account(gc); | 679 account = gaim_connection_get_account(gc); |
| 680 if (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->set_permit_deny == NULL) { | |
| 681 /* protocol does not support privacy, handle it ourselves */ | |
| 682 if (!gaim_privacy_check(account, who)) | |
| 683 return; | |
| 684 } | |
| 672 | 685 |
| 673 plugin_return = GPOINTER_TO_INT(gaim_signal_emit_return_1( | 686 plugin_return = GPOINTER_TO_INT(gaim_signal_emit_return_1( |
| 674 gaim_conversations_get_handle(), | 687 gaim_conversations_get_handle(), |
| 675 "chat-invited", account, who, name, message, data)); | 688 "chat-invited", account, who, name, message, data)); |
| 676 | 689 |
