aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/gossip-chat-window.c28
-rw-r--r--libempathy-gtk/gossip-chat-window.h1
2 files changed, 29 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;
+}
+
diff --git a/libempathy-gtk/gossip-chat-window.h b/libempathy-gtk/gossip-chat-window.h
index 783dc5b63..18b06ad90 100644
--- a/libempathy-gtk/gossip-chat-window.h
+++ b/libempathy-gtk/gossip-chat-window.h
@@ -70,6 +70,7 @@ void gossip_chat_window_move_chat (GossipChatWindow *old_wind
void gossip_chat_window_switch_to_chat (GossipChatWindow *window,
GossipChat *chat);
gboolean gossip_chat_window_has_focus (GossipChatWindow *window);
+GossipChat * gossip_chat_window_find_chat_by_id (const gchar *id);
G_END_DECLS