| 147 |
147 |
| 148 static int |
148 static int |
| 149 alert(PurpleConversation *conv) |
149 alert(PurpleConversation *conv) |
| 150 { |
150 { |
| 151 gint count; |
151 gint count; |
| 152 PidginConvWindow *purplewin = NULL; |
152 PidginConversation *gtkconv = NULL; |
| |
153 PidginConversationWindow *convwin = NULL; |
| |
154 GtkWidget *win = NULL; |
| |
155 |
| 153 if (conv == NULL || PIDGIN_CONVERSATION(conv) == NULL) |
156 if (conv == NULL || PIDGIN_CONVERSATION(conv) == NULL) |
| 154 return 0; |
157 return 0; |
| 155 |
158 |
| 156 purplewin = PIDGIN_CONVERSATION(conv)->win; |
159 gtkconv = PIDGIN_CONVERSATION(conv); |
| 157 |
160 win = gtk_widget_get_toplevel(gtkconv->tab_cont); |
| 158 if (!pidgin_conv_window_has_focus(purplewin) || |
161 convwin = PIDGIN_CONVERSATION_WINDOW(win); |
| 159 !pidgin_conv_window_is_active_conversation(conv)) |
162 |
| |
163 if (!gtk_widget_has_focus(win) || |
| |
164 !pidgin_conversation_window_conversation_is_selected(convwin, conv)) |
| 160 { |
165 { |
| 161 count = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), |
166 count = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(conv), |
| 162 "unity-message-count")); |
167 "unity-message-count")); |
| 163 if (!count++) |
168 if (!count++) |
| 164 ++n_sources; |
169 ++n_sources; |
| 254 { |
259 { |
| 255 gchar **sections = g_strsplit(id, ":", 0); |
260 gchar **sections = g_strsplit(id, ":", 0); |
| 256 PurpleConversation *conv = NULL; |
261 PurpleConversation *conv = NULL; |
| 257 PurpleConversationManager *manager = NULL; |
262 PurpleConversationManager *manager = NULL; |
| 258 PurpleAccount *account; |
263 PurpleAccount *account; |
| 259 PidginConvWindow *purplewin = NULL; |
|
| 260 |
264 |
| 261 char *type = sections[0]; |
265 char *type = sections[0]; |
| 262 char *cname = sections[1]; |
266 char *cname = sections[1]; |
| 263 char *aname = sections[2]; |
267 char *aname = sections[2]; |
| 264 char *protocol = sections[3]; |
268 char *protocol = sections[3]; |
| 274 } else { |
278 } else { |
| 275 conv = purple_conversation_manager_find(manager, account, cname); |
279 conv = purple_conversation_manager_find(manager, account, cname); |
| 276 } |
280 } |
| 277 |
281 |
| 278 if (conv) { |
282 if (conv) { |
| |
283 GtkWidget *win = NULL; |
| |
284 PidginConversationWindow *convwin = NULL; |
| |
285 |
| |
286 win = gtk_widget_get_toplevel(PIDGIN_CONVERSATION(conv)->tab_cont); |
| |
287 convwin = PIDGIN_CONVERSATION_WINDOW(win); |
| |
288 |
| 279 unalert(conv); |
289 unalert(conv); |
| 280 purplewin = PIDGIN_CONVERSATION(conv)->win; |
290 |
| 281 pidgin_conv_window_switch_gtkconv(purplewin, PIDGIN_CONVERSATION(conv)); |
291 pidgin_conversation_window_select(convwin, conv); |
| 282 gdk_window_focus(gtk_widget_get_window(purplewin->window), time(NULL)); |
292 gdk_window_focus(gtk_widget_get_window(win), time(NULL)); |
| 283 } |
293 } |
| 284 g_strfreev (sections); |
294 g_strfreev (sections); |
| 285 } |
295 } |
| 286 |
296 |
| 287 static PurpleSavedStatus * |
297 static PurpleSavedStatus * |