| 91 signon_cb(PurpleConnection *gc) |
91 signon_cb(PurpleConnection *gc) |
| 92 { |
92 { |
| 93 PurpleBuddyList *list = purple_get_blist(); |
93 PurpleBuddyList *list = purple_get_blist(); |
| 94 if (list && PURPLE_IS_GTK_BLIST(list) && !timer) { |
94 if (list && PURPLE_IS_GTK_BLIST(list) && !timer) { |
| 95 check_timeout(NULL); /* we want the box to be drawn immediately */ |
95 check_timeout(NULL); /* we want the box to be drawn immediately */ |
| 96 timer = g_timeout_add(2000, check_timeout, NULL); |
96 timer = purple_timeout_add_seconds(2, check_timeout, NULL); |
| 97 } |
97 } |
| 98 } |
98 } |
| 99 |
99 |
| 100 static void |
100 static void |
| 101 signoff_cb(PurpleConnection *gc) |
101 signoff_cb(PurpleConnection *gc) |
| 102 { |
102 { |
| 103 PurpleBuddyList *list = purple_get_blist(); |
103 PurpleBuddyList *list = purple_get_blist(); |
| 104 if ((!list || !PURPLE_IS_GTK_BLIST(list) || !PIDGIN_BLIST(list)->vbox) && timer) { |
104 if ((!list || !PURPLE_IS_GTK_BLIST(list) || !PIDGIN_BLIST(list)->vbox) && timer) { |
| 105 g_source_remove(timer); |
105 purple_timeout_remove(timer); |
| 106 timer = 0; |
106 timer = 0; |
| 107 } |
107 } |
| 108 } |
108 } |
| 109 |
109 |
| 110 /* |
110 /* |
| 121 purple_debug_warning("mailchk", "Could not read $MAIL or /var/spool/mail/$USER\n"); |
121 purple_debug_warning("mailchk", "Could not read $MAIL or /var/spool/mail/$USER\n"); |
| 122 return FALSE; |
122 return FALSE; |
| 123 } |
123 } |
| 124 |
124 |
| 125 if (list && PURPLE_IS_GTK_BLIST(list) && PIDGIN_BLIST(list)->vbox) |
125 if (list && PURPLE_IS_GTK_BLIST(list) && PIDGIN_BLIST(list)->vbox) |
| 126 timer = g_timeout_add(2000, check_timeout, NULL); |
126 timer = purple_timeout_add_seconds(2, check_timeout, NULL); |
| 127 |
127 |
| 128 purple_signal_connect(conn_handle, "signed-on", |
128 purple_signal_connect(conn_handle, "signed-on", |
| 129 plugin, PURPLE_CALLBACK(signon_cb), NULL); |
129 plugin, PURPLE_CALLBACK(signon_cb), NULL); |
| 130 purple_signal_connect(conn_handle, "signed-off", |
130 purple_signal_connect(conn_handle, "signed-off", |
| 131 plugin, PURPLE_CALLBACK(signoff_cb), NULL); |
131 plugin, PURPLE_CALLBACK(signoff_cb), NULL); |