| 89 } |
89 } |
| 90 |
90 |
| 91 static void |
91 static void |
| 92 signon_cb(PurpleConnection *gc) |
92 signon_cb(PurpleConnection *gc) |
| 93 { |
93 { |
| 94 PurpleBuddyList *list = purple_blist_get_buddy_list(); |
94 PurpleBuddyList *list = purple_blist_get_default(); |
| 95 if (list && !timer) { |
95 if (list && !timer) { |
| 96 check_timeout(NULL); /* we want the box to be drawn immediately */ |
96 check_timeout(NULL); /* we want the box to be drawn immediately */ |
| 97 timer = g_timeout_add_seconds(2, check_timeout, NULL); |
97 timer = g_timeout_add_seconds(2, check_timeout, NULL); |
| 98 } |
98 } |
| 99 } |
99 } |
| 100 |
100 |
| 101 static void |
101 static void |
| 102 signoff_cb(PurpleConnection *gc) |
102 signoff_cb(PurpleConnection *gc) |
| 103 { |
103 { |
| 104 PurpleBuddyList *list = purple_blist_get_buddy_list(); |
104 PurpleBuddyList *list = purple_blist_get_default(); |
| 105 if ((!list || !PIDGIN_BLIST(list)->vbox) && timer) { |
105 if ((!list || !PIDGIN_BLIST(list)->vbox) && timer) { |
| 106 g_source_remove(timer); |
106 g_source_remove(timer); |
| 107 timer = 0; |
107 timer = 0; |
| 108 } |
108 } |
| 109 } |
109 } |
| 136 } |
136 } |
| 137 |
137 |
| 138 static gboolean |
138 static gboolean |
| 139 plugin_load(PurplePlugin *plugin, GError **error) |
139 plugin_load(PurplePlugin *plugin, GError **error) |
| 140 { |
140 { |
| 141 PurpleBuddyList *list = purple_blist_get_buddy_list(); |
141 PurpleBuddyList *list = purple_blist_get_default(); |
| 142 void *conn_handle = purple_connections_get_handle(); |
142 void *conn_handle = purple_connections_get_handle(); |
| 143 |
143 |
| 144 if (!check_timeout(NULL)) { |
144 if (!check_timeout(NULL)) { |
| 145 g_set_error(error, MAILCHK_PLUGIN_DOMAIN, 0, _("Could not read $MAIL " |
145 g_set_error(error, MAILCHK_PLUGIN_DOMAIN, 0, _("Could not read $MAIL " |
| 146 "or /var/spool/mail/$USER\n")); |
146 "or /var/spool/mail/$USER\n")); |