aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/gossip-chat-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk/gossip-chat-window.c')
-rw-r--r--libempathy-gtk/gossip-chat-window.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libempathy-gtk/gossip-chat-window.c b/libempathy-gtk/gossip-chat-window.c
index 62ace37b4..fb112379b 100644
--- a/libempathy-gtk/gossip-chat-window.c
+++ b/libempathy-gtk/gossip-chat-window.c
@@ -1874,3 +1874,31 @@ gossip_chat_window_has_focus (GossipChatWindow *window)
return has_focus;
}
+
+GossipChat *
+gossip_chat_window_find_chat_by_id (const gchar *id)
+{
+ GList *l;
+
+ for (l = chat_windows; l; l = l->next) {
+ GossipChatWindowPriv *priv;
+ GossipChatWindow *window;
+ GList *ll;
+
+ window = l->data;
+ priv = GET_PRIV (window);
+
+ for (ll = priv->chats; ll; ll = ll->next) {
+ GossipChat *chat;
+
+ chat = ll->data;
+
+ if (strcmp (id, gossip_chat_get_id (chat)) == 0) {
+ return chat;
+ }
+ }
+ }
+
+ return NULL;
+}
+