From b15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 13 May 2007 20:29:46 +0000 Subject: When a new text channel arrives, check if there is no existing GossipChat 2006-05-13 Xavier Claessens * libempathy-gtk/gossip-chat-window.c: * libempathy-gtk/gossip-chat-window.h: * src/empathy-chat-main.c: * libempathy/empathy-tp-chat.c: * libempathy/empathy-tp-chat.h: When a new text channel arrives, check if there is no existing GossipChat object for it. svn path=/trunk/; revision=56 --- libempathy-gtk/gossip-chat-window.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'libempathy-gtk/gossip-chat-window.c') 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; +} + -- cgit v1.2.3