diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-05-05 14:22:23 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-05-05 14:22:23 +0800 |
commit | 376bd27843d83ee42e3d731f9856fff9d522aa3c (patch) | |
tree | bc570b10a93af270f743a6918cf33e9d89d54f7e /src | |
parent | 81a61a2bf34bf2ea7f262f96279a27978c62317e (diff) | |
download | gsoc2013-empathy-376bd27843d83ee42e3d731f9856fff9d522aa3c.tar gsoc2013-empathy-376bd27843d83ee42e3d731f9856fff9d522aa3c.tar.gz gsoc2013-empathy-376bd27843d83ee42e3d731f9856fff9d522aa3c.tar.bz2 gsoc2013-empathy-376bd27843d83ee42e3d731f9856fff9d522aa3c.tar.lz gsoc2013-empathy-376bd27843d83ee42e3d731f9856fff9d522aa3c.tar.xz gsoc2013-empathy-376bd27843d83ee42e3d731f9856fff9d522aa3c.tar.zst gsoc2013-empathy-376bd27843d83ee42e3d731f9856fff9d522aa3c.zip |
Include SMSChannel property in empathy_chat_window_find_chat()
The approach in https://bugzilla.gnome.org/show_bug.cgi?id=644085 was wrong
because channel paths can change across reconnects. This would cause new chat
windows to be created when they were rerequested.
A more future-proof solution would be to keep a white/black list of comparable
properties, but I think this is overengineering the problem for the time
being. Instead we'll just include the SMSChannel property in the comparison.
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-chat-manager.c | 3 | ||||
-rw-r--r-- | src/empathy-chat-window.c | 8 | ||||
-rw-r--r-- | src/empathy-chat-window.h | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c index 6de733983..b31684069 100644 --- a/src/empathy-chat-manager.c +++ b/src/empathy-chat-manager.c @@ -126,7 +126,8 @@ process_tp_chat (EmpathyTpChat *tp_chat, id = empathy_tp_chat_get_id (tp_chat); if (!tp_str_empty (id)) { - chat = empathy_chat_window_find_chat (account, id); + chat = empathy_chat_window_find_chat (account, id, + empathy_tp_chat_is_sms_channel (tp_chat)); } if (chat != NULL) diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 5ae37f660..7dcc996ac 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -1817,7 +1817,7 @@ chat_window_drag_data_received (GtkWidget *widget, account = tp_account_manager_ensure_account (account_manager, account_id); if (account != NULL) - chat = empathy_chat_window_find_chat (account, contact_id); + chat = empathy_chat_window_find_chat (account, contact_id, FALSE); } if (account == NULL) { @@ -2395,7 +2395,8 @@ empathy_chat_window_has_focus (EmpathyChatWindow *window) EmpathyChat * empathy_chat_window_find_chat (TpAccount *account, - const gchar *id) + const gchar *id, + gboolean sms_channel) { GList *l; @@ -2415,7 +2416,8 @@ empathy_chat_window_find_chat (TpAccount *account, chat = ll->data; if (account == empathy_chat_get_account (chat) && - !tp_strdiff (id, empathy_chat_get_id (chat))) { + !tp_strdiff (id, empathy_chat_get_id (chat)) && + sms_channel == empathy_chat_is_sms_channel (chat)) { return chat; } } diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h index 4cbd2094a..f8425e172 100644 --- a/src/empathy-chat-window.h +++ b/src/empathy-chat-window.h @@ -71,7 +71,8 @@ void empathy_chat_window_switch_to_chat (EmpathyChatWindow *window EmpathyChat *chat); gboolean empathy_chat_window_has_focus (EmpathyChatWindow *window); EmpathyChat * empathy_chat_window_find_chat (TpAccount *account, - const gchar *id); + const gchar *id, + gboolean sms_channel); void empathy_chat_window_present_chat (EmpathyChat *chat, gint64 timestamp); |