annotate plugins/statenotify.c @ 13577:48d7074f2297

[gaim-migrate @ 15957] Debug.xs and Signal.xs aren't being built and are missing from the dist. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 29 Mar 2006 15:07:30 +0000
parents 465c368366f8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
1 #include "internal.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
2
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
3 #include "blist.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
4 #include "conversation.h"
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
5 #include "debug.h"
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6441
diff changeset
6 #include "signals.h"
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9648
diff changeset
7 #include "version.h"
5872
059d95c67cda [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5676
diff changeset
8
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
9 #include "plugin.h"
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
10 #include "pluginpref.h"
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
11 #include "prefs.h"
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
12
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
13 #define STATENOTIFY_PLUGIN_ID "core-statenotify"
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
14
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 static void
6695
0c5637b5462e [gaim-migrate @ 7221]
Nathan Walp <nwalp@pidgin.im>
parents: 6621
diff changeset
16 write_status(GaimBuddy *buddy, const char *message)
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 {
5676
dae79aefac8d [gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents: 5587
diff changeset
18 GaimConversation *conv;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6441
diff changeset
19 const char *who;
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 char buf[256];
10167
cf45c2a6a7cf [gaim-migrate @ 11254]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9943
diff changeset
21 char *escaped;
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22
11338
17142948653e [gaim-migrate @ 13551]
Mark Doliner <mark@kingant.net>
parents: 10246
diff changeset
23 conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM,
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10167
diff changeset
24 buddy->name, buddy->account);
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 if (conv == NULL)
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 return;
13476
465c368366f8 [gaim-migrate @ 15852]
Richard Laager <rlaager@wiktel.com>
parents: 12600
diff changeset
28 g_return_if_fail(conv->type == GAIM_CONV_TYPE_IM);
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
9620
c001be3c330e [gaim-migrate @ 10464]
Mark Doliner <mark@kingant.net>
parents: 9583
diff changeset
30 who = gaim_buddy_get_alias(buddy);
10167
cf45c2a6a7cf [gaim-migrate @ 11254]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9943
diff changeset
31 escaped = g_markup_escape_text(who, -1);
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32
10167
cf45c2a6a7cf [gaim-migrate @ 11254]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9943
diff changeset
33 g_snprintf(buf, sizeof(buf), message, escaped);
cf45c2a6a7cf [gaim-migrate @ 11254]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9943
diff changeset
34 g_free(escaped);
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
13476
465c368366f8 [gaim-migrate @ 15852]
Richard Laager <rlaager@wiktel.com>
parents: 12600
diff changeset
36 gaim_conv_im_write(conv->u.im, NULL, buf, GAIM_MESSAGE_SYSTEM | GAIM_MESSAGE_ACTIVE_ONLY, time(NULL));
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 }
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 static void
11935
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
40 buddy_status_changed_cb(GaimBuddy *buddy, GaimStatus *old_status,
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
41 GaimStatus *status, void *data)
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 {
11935
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
43 gboolean available, old_available;
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
44
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
45 available = gaim_status_is_available(status);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
46 old_available = gaim_status_is_available(old_status);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
47
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
48 if (gaim_prefs_get_bool("/plugins/core/statenotify/notify_away")) {
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
49 if (available && !old_available)
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
50 write_status(buddy, _("%s is no longer away."));
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
51 else if (!available && old_available)
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
52 write_status(buddy, _("%s has gone away."));
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
53 }
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54 }
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 static void
11935
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
57 buddy_idle_changed_cb(GaimBuddy *buddy, gboolean old_idle, gboolean idle,
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
58 void *data)
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 {
11935
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
60 if (gaim_prefs_get_bool("/plugins/core/statenotify/notify_idle")) {
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
61 if (idle) {
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
62 write_status(buddy, _("%s has become idle."));
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
63 } else {
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
64 write_status(buddy, _("%s is no longer idle."));
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
65 }
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
66 }
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
67 }
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
68
11901
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
69 static void
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
70 buddy_signon_cb(GaimBuddy *buddy, void *data)
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
71 {
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
72 if (gaim_prefs_get_bool("/plugins/core/statenotify/notify_signon"))
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
73 write_status(buddy, _("%s has signed on."));
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
74 }
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
75
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
76 static void
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
77 buddy_signoff_cb(GaimBuddy *buddy, void *data)
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
78 {
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
79 if (gaim_prefs_get_bool("/plugins/core/statenotify/notify_signon"))
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
80 write_status(buddy, _("%s has signed off."));
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
81 }
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
82
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
83 static GaimPluginPrefFrame *
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
84 get_plugin_pref_frame(GaimPlugin *plugin)
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
85 {
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
86 GaimPluginPrefFrame *frame;
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
87 GaimPluginPref *ppref;
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
88
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
89 frame = gaim_plugin_pref_frame_new();
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
90
9648
2316cb7a115f [gaim-migrate @ 10496]
Mark Doliner <mark@kingant.net>
parents: 9620
diff changeset
91 ppref = gaim_plugin_pref_new_with_label(_("Notify When"));
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
92 gaim_plugin_pref_frame_add(frame, ppref);
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
93
9648
2316cb7a115f [gaim-migrate @ 10496]
Mark Doliner <mark@kingant.net>
parents: 9620
diff changeset
94 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_away", _("Buddy Goes _Away"));
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
95 gaim_plugin_pref_frame_add(frame, ppref);
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10167
diff changeset
96
9648
2316cb7a115f [gaim-migrate @ 10496]
Mark Doliner <mark@kingant.net>
parents: 9620
diff changeset
97 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_idle", _("Buddy Goes _Idle"));
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
98 gaim_plugin_pref_frame_add(frame, ppref);
10246
a66cf83552dc [gaim-migrate @ 11386]
Mark Doliner <mark@kingant.net>
parents: 10167
diff changeset
99
11901
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
100 ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/statenotify/notify_signon", _("Buddy _Signs On/Off"));
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
101 gaim_plugin_pref_frame_add(frame, ppref);
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
102
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
103 return frame;
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104 }
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 static gboolean
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 plugin_load(GaimPlugin *plugin)
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 {
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6441
diff changeset
109 void *blist_handle = gaim_blist_get_handle();
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6441
diff changeset
110
11935
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
111 gaim_signal_connect(blist_handle, "buddy-status-changed", plugin,
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
112 GAIM_CALLBACK(buddy_status_changed_cb), NULL);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
113 gaim_signal_connect(blist_handle, "buddy-idle-changed", plugin,
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
114 GAIM_CALLBACK(buddy_idle_changed_cb), NULL);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
115 gaim_signal_connect(blist_handle, "buddy-signed-on", plugin,
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
116 GAIM_CALLBACK(buddy_signon_cb), NULL);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
117 gaim_signal_connect(blist_handle, "buddy-signed-off", plugin,
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11901
diff changeset
118 GAIM_CALLBACK(buddy_signoff_cb), NULL);
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 return TRUE;
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 }
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
123 static GaimPluginUiInfo prefs_info =
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
124 {
12600
e856f985a0b9 [gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents: 11935
diff changeset
125 get_plugin_pref_frame,
e856f985a0b9 [gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents: 11935
diff changeset
126 0, /* page_num (Reserved) */
e856f985a0b9 [gaim-migrate @ 14934]
Richard Laager <rlaager@wiktel.com>
parents: 11935
diff changeset
127 NULL /* frame (Reserved) */
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
128 };
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
129
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 static GaimPluginInfo info =
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 {
9943
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9648
diff changeset
132 GAIM_PLUGIN_MAGIC,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9648
diff changeset
133 GAIM_MAJOR_VERSION,
f8e395a054e2 [gaim-migrate @ 10835]
Nathan Walp <nwalp@pidgin.im>
parents: 9648
diff changeset
134 GAIM_MINOR_VERSION,
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 GAIM_PLUGIN_STANDARD, /**< type */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136 NULL, /**< ui_requirement */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137 0, /**< flags */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 NULL, /**< dependencies */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 GAIM_PRIORITY_DEFAULT, /**< priority */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
141 STATENOTIFY_PLUGIN_ID, /**< id */
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 N_("Buddy State Notification"), /**< name */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 VERSION, /**< version */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 /** summary */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 N_("Notifies in a conversation window when a buddy goes or returns from "
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 "away or idle."),
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147 /** description */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148 N_("Notifies in a conversation window when a buddy goes or returns from "
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 "away or idle."),
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150 "Christian Hammond <chipx86@gnupdate.org>", /**< author */
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents: 6441
diff changeset
151 GAIM_WEBSITE, /**< homepage */
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 plugin_load, /**< load */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 NULL, /**< unload */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155 NULL, /**< destroy */
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157 NULL, /**< ui_info */
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
158 NULL, /**< extra_info */
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
159 &prefs_info, /**< prefs_info */
8993
294ae6548d4e [gaim-migrate @ 9768]
Luke Schierer <lschiere@pidgin.im>
parents: 8749
diff changeset
160 NULL
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
161 };
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
163 static void
5920
7d385de2f9cd [gaim-migrate @ 6360]
Christian Hammond <chipx86@chipx86.com>
parents: 5873
diff changeset
164 init_plugin(GaimPlugin *plugin)
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 {
9583
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
166 gaim_prefs_add_none("/plugins/core/statenotify");
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
167 gaim_prefs_add_bool("/plugins/core/statenotify/notify_away", TRUE);
91c9e060111b [gaim-migrate @ 10426]
Luke Schierer <lschiere@pidgin.im>
parents: 8993
diff changeset
168 gaim_prefs_add_bool("/plugins/core/statenotify/notify_idle", TRUE);
11901
077f956e41a1 [gaim-migrate @ 14192]
Stu Tomlinson <stu@nosnilmot.com>
parents: 11338
diff changeset
169 gaim_prefs_add_bool("/plugins/core/statenotify/notify_signon", TRUE);
5267
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170 }
3cd24f012091 [gaim-migrate @ 5639]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171
6063
5239a3b4ab33 [gaim-migrate @ 6513]
Nathan Walp <nwalp@pidgin.im>
parents: 5920
diff changeset
172 GAIM_INIT_PLUGIN(statenotify, init_plugin, info)