comparison plugins/statenotify.c @ 11901:077f956e41a1

[gaim-migrate @ 14192] Patch 1342474 from Francesco Fracassi - add buddy signon & signoff to the buddy state notification plugin committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sun, 30 Oct 2005 17:18:20 +0000
parents 17142948653e
children cb73483c9f63
comparison
equal deleted inserted replaced
11900:21719fc8ea2d 11901:077f956e41a1
61 { 61 {
62 if (gaim_prefs_get_bool("/plugins/core/statenotify/notify_idle")) 62 if (gaim_prefs_get_bool("/plugins/core/statenotify/notify_idle"))
63 write_status(buddy, _("%s is no longer idle.")); 63 write_status(buddy, _("%s is no longer idle."));
64 } 64 }
65 65
66 static void
67 buddy_signon_cb(GaimBuddy *buddy, void *data)
68 {
69 if (gaim_prefs_get_bool("/plugins/core/statenotify/notify_signon"))
70 write_status(buddy, _("%s has signed on."));
71 }
72
73 static void
74 buddy_signoff_cb(GaimBuddy *buddy, void *data)
75 {
76 if (gaim_prefs_get_bool("/plugins/core/statenotify/notify_signon"))
77 write_status(buddy, _("%s has signed off."));
78 }
79
66 static GaimPluginPrefFrame * 80 static GaimPluginPrefFrame *
67 get_plugin_pref_frame(GaimPlugin *plugin) 81 get_plugin_pref_frame(GaimPlugin *plugin)
68 { 82 {
69 GaimPluginPrefFrame *frame; 83 GaimPluginPrefFrame *frame;
70 GaimPluginPref *ppref; 84 GaimPluginPref *ppref;
76 90
77 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_away", _("Buddy Goes _Away")); 91 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_away", _("Buddy Goes _Away"));
78 gaim_plugin_pref_frame_add(frame, ppref); 92 gaim_plugin_pref_frame_add(frame, ppref);
79 93
80 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_idle", _("Buddy Goes _Idle")); 94 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_idle", _("Buddy Goes _Idle"));
95 gaim_plugin_pref_frame_add(frame, ppref);
96
97 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_signon", _("Buddy _Signs On/Off"));
81 gaim_plugin_pref_frame_add(frame, ppref); 98 gaim_plugin_pref_frame_add(frame, ppref);
82 99
83 return frame; 100 return frame;
84 } 101 }
85 102
94 plugin, GAIM_CALLBACK(buddy_unaway_cb), NULL); 111 plugin, GAIM_CALLBACK(buddy_unaway_cb), NULL);
95 gaim_signal_connect(blist_handle, "buddy-idle", 112 gaim_signal_connect(blist_handle, "buddy-idle",
96 plugin, GAIM_CALLBACK(buddy_idle_cb), NULL); 113 plugin, GAIM_CALLBACK(buddy_idle_cb), NULL);
97 gaim_signal_connect(blist_handle, "buddy-unidle", 114 gaim_signal_connect(blist_handle, "buddy-unidle",
98 plugin, GAIM_CALLBACK(buddy_unidle_cb), NULL); 115 plugin, GAIM_CALLBACK(buddy_unidle_cb), NULL);
116 gaim_signal_connect(blist_handle, "buddy-signed-on",
117 plugin, GAIM_CALLBACK(buddy_signon_cb), NULL);
118 gaim_signal_connect(blist_handle, "buddy-signed-off",
119 plugin, GAIM_CALLBACK(buddy_signoff_cb), NULL);
99 120
100 return TRUE; 121 return TRUE;
101 } 122 }
102 123
103 static GaimPluginUiInfo prefs_info = 124 static GaimPluginUiInfo prefs_info =
142 init_plugin(GaimPlugin *plugin) 163 init_plugin(GaimPlugin *plugin)
143 { 164 {
144 gaim_prefs_add_none("/plugins/core/statenotify"); 165 gaim_prefs_add_none("/plugins/core/statenotify");
145 gaim_prefs_add_bool("/plugins/core/statenotify/notify_away", TRUE); 166 gaim_prefs_add_bool("/plugins/core/statenotify/notify_away", TRUE);
146 gaim_prefs_add_bool("/plugins/core/statenotify/notify_idle", TRUE); 167 gaim_prefs_add_bool("/plugins/core/statenotify/notify_idle", TRUE);
168 gaim_prefs_add_bool("/plugins/core/statenotify/notify_signon", TRUE);
147 } 169 }
148 170
149 GAIM_INIT_PLUGIN(statenotify, init_plugin, info) 171 GAIM_INIT_PLUGIN(statenotify, init_plugin, info)