aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-05-14 04:29:46 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-14 04:29:46 +0800
commitb15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88 (patch)
tree318435ee27d45751c3a8c95112e7342f1b0b5909 /libempathy-gtk
parentebceb937aba409b8760330e79da6018363f60d5b (diff)
downloadgsoc2013-empathy-b15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88.tar
gsoc2013-empathy-b15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88.tar.gz
gsoc2013-empathy-b15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88.tar.bz2
gsoc2013-empathy-b15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88.tar.lz
gsoc2013-empathy-b15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88.tar.xz
gsoc2013-empathy-b15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88.tar.zst
gsoc2013-empathy-b15fdb2c66e8c18a9f8db03cbd0cfa9dfb569e88.zip
When a new text channel arrives, check if there is no existing GossipChat
2006-05-13 Xavier Claessens <xclaesse@gmail.com> * 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
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