comparison libpurple/plugins/psychic.c @ 17977:f71bd7e56389

propagate from branch 'im.pidgin.pidgin' (head b438ea0760758dc547f95d62892455f50ee4c4f1) to branch 'im.pidgin.soc.2007.remotelogging' (head 7e683fd40634aa3eb22dcf25cbd25c8959d76662)
author Michael Shkutkov <mshkutkov@soc.pidgin.im>
date Sat, 09 Jun 2007 12:01:29 +0000
parents 56042b2f8b64
children 941965d6fd88
comparison
equal deleted inserted replaced
17697:9da82444eee3 17977:f71bd7e56389
7 #include "conversation.h" 7 #include "conversation.h"
8 #include "debug.h" 8 #include "debug.h"
9 #include "signals.h" 9 #include "signals.h"
10 #include "status.h" 10 #include "status.h"
11 #include "version.h" 11 #include "version.h"
12 #include "privacy.h"
12 13
13 #include "plugin.h" 14 #include "plugin.h"
14 #include "pluginpref.h" 15 #include "pluginpref.h"
15 #include "prefs.h" 16 #include "prefs.h"
16 17
18 #define PLUGIN_ID "core-psychic" 19 #define PLUGIN_ID "core-psychic"
19 #define PLUGIN_NAME N_("Psychic Mode") 20 #define PLUGIN_NAME N_("Psychic Mode")
20 #define PLUGIN_SUMMARY N_("Psychic mode for incoming conversation") 21 #define PLUGIN_SUMMARY N_("Psychic mode for incoming conversation")
21 #define PLUGIN_DESC N_("Causes conversation windows to appear as other" \ 22 #define PLUGIN_DESC N_("Causes conversation windows to appear as other" \
22 " users begin to message you. This works for" \ 23 " users begin to message you. This works for" \
23 " AIM, ICQ, Jabber, Sametime, and Yahoo!") 24 " AIM, ICQ, XMPP, Sametime, and Yahoo!")
24 #define PLUGIN_AUTHOR "Christopher O'Brien <siege@preoccupied.net>" 25 #define PLUGIN_AUTHOR "Christopher O'Brien <siege@preoccupied.net>"
25 26
26 27
27 #define PREFS_BASE "/plugins/core/psychic" 28 #define PREFS_BASE "/plugins/core/psychic"
28 #define PREF_BUDDIES PREFS_BASE "/buddies_only" 29 #define PREF_BUDDIES PREFS_BASE "/buddies_only"
42 } 43 }
43 44
44 if(purple_prefs_get_bool(PREF_BUDDIES) && 45 if(purple_prefs_get_bool(PREF_BUDDIES) &&
45 ! purple_find_buddy(acct, name)) { 46 ! purple_find_buddy(acct, name)) {
46 purple_debug_info("psychic", "not in blist, doing nothing\n"); 47 purple_debug_info("psychic", "not in blist, doing nothing\n");
48 return;
49 }
50
51 if(FALSE == purple_privacy_check(acct, name)) {
52 purple_debug_info("psychic", "user %s is blocked", name);
47 return; 53 return;
48 } 54 }
49 55
50 gconv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, acct); 56 gconv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, acct);
51 if(! gconv) { 57 if(! gconv) {
118 124
119 static PurplePluginUiInfo prefs_info = { 125 static PurplePluginUiInfo prefs_info = {
120 get_plugin_pref_frame, 126 get_plugin_pref_frame,
121 0, /* page_num (Reserved) */ 127 0, /* page_num (Reserved) */
122 NULL, /* frame (Reserved) */ 128 NULL, /* frame (Reserved) */
129
130 /* padding */
131 NULL,
132 NULL,
133 NULL,
134 NULL
123 }; 135 };
124 136
125 137
126 static PurplePluginInfo info = { 138 static PurplePluginInfo info = {
127 PURPLE_PLUGIN_MAGIC, 139 PURPLE_PLUGIN_MAGIC,
147 159
148 NULL, /**< ui_info */ 160 NULL, /**< ui_info */
149 NULL, /**< extra_info */ 161 NULL, /**< extra_info */
150 &prefs_info, /**< prefs_info */ 162 &prefs_info, /**< prefs_info */
151 NULL, /**< actions */ 163 NULL, /**< actions */
164
165 /* padding */
166 NULL,
167 NULL,
168 NULL,
169 NULL
152 }; 170 };
153 171
154 172
155 static void 173 static void
156 init_plugin(PurplePlugin *plugin) { 174 init_plugin(PurplePlugin *plugin) {