diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-chat-window.c | 12 | ||||
-rw-r--r-- | src/empathy-filter.c | 21 |
2 files changed, 24 insertions, 9 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 09a0e4589..4125f9743 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -34,6 +34,7 @@ #include <glade/glade.h> #include <glib/gi18n.h> +#include <telepathy-glib/util.h> #include <libmissioncontrol/mission-control.h> #include <libempathy/empathy-contact-factory.h> @@ -470,17 +471,18 @@ chat_window_clear_activate_cb (GtkWidget *menuitem, static const gchar * chat_get_window_id_for_geometry (EmpathyChat *chat) { - gboolean separate_windows; + const gchar *res = NULL; + gboolean separate_windows; empathy_conf_get_bool (empathy_conf_get (), EMPATHY_PREFS_UI_SEPARATE_CHAT_WINDOWS, &separate_windows); if (separate_windows) { - return empathy_chat_get_id (chat); - } else { - return "chat-window"; + res = empathy_chat_get_id (chat); } + + return res ? res : "chat-window"; } static gboolean @@ -1455,7 +1457,7 @@ empathy_chat_window_find_chat (McAccount *account, chat = ll->data; if (empathy_account_equal (account, empathy_chat_get_account (chat)) && - strcmp (id, empathy_chat_get_id (chat)) == 0) { + !tp_strdiff (id, empathy_chat_get_id (chat))) { return chat; } } diff --git a/src/empathy-filter.c b/src/empathy-filter.c index 0b2999b4e..d32a9dfe1 100644 --- a/src/empathy-filter.c +++ b/src/empathy-filter.c @@ -183,13 +183,25 @@ filter_chat_dispatch (EmpathyFilter *filter, gpointer user_data) { EmpathyTpChat *tp_chat = EMPATHY_TP_CHAT (user_data); - McAccount *account; - EmpathyChat *chat; + EmpathyChat *chat = NULL; const gchar *id; id = empathy_tp_chat_get_id (tp_chat); - account = empathy_tp_chat_get_account (tp_chat); - chat = empathy_chat_window_find_chat (account, id); + if (!id) { + EmpathyContact *contact; + + contact = empathy_tp_chat_get_remote_contact (tp_chat); + if (contact) { + id = empathy_contact_get_id (contact); + } + } + + if (id) { + McAccount *account; + + account = empathy_tp_chat_get_account (tp_chat); + chat = empathy_chat_window_find_chat (account, id); + } if (chat) { empathy_chat_set_tp_chat (chat, tp_chat); @@ -235,6 +247,7 @@ filter_chat_handle_channel (EmpathyFilter *filter, channel); tp_chat = empathy_tp_chat_new (channel, FALSE); + empathy_run_until_ready (tp_chat); if (is_incoming) { filter_chat_dispatch (filter, tp_chat); } else { |