pidgin/plugins/mailchk.c

changeset 39665
2172e3b8eeef
parent 38433
361c801c4536
child 40360
e21f3bbcc2a5
equal deleted inserted replaced
39639:fe7fa102e766 39665:2172e3b8eeef
54 54
55 static gboolean 55 static gboolean
56 check_timeout(gpointer data) 56 check_timeout(gpointer data)
57 { 57 {
58 gint count = check_mail(); 58 gint count = check_mail();
59 PurpleBuddyList *list = purple_blist_get_buddy_list(); 59 PurpleBuddyList *list = purple_blist_get_default();
60 60
61 if (count == -1) 61 if (count == -1)
62 return FALSE; 62 return FALSE;
63 63
64 if (!list || !(PIDGIN_BLIST(list)->vbox)) 64 if (!list || !(PIDGIN_BLIST(list)->vbox))
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"));

mercurial