From 4668820d31cf3cea3587bf9e80f609b3838c4a74 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Sun, 9 Jan 2011 22:29:23 +0100 Subject: [PATCH] sipe_session_find_im(): don't incorrectly return call sessions When parallel IM session and voice call is running with the same buddy, the function could return the call session instead of IM. --- src/core/sipe-session.c | 3 ++- src/core/sipe-session.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/sipe-session.c b/src/core/sipe-session.c index 1a66f7f1..dcbc510c 100644 --- a/src/core/sipe-session.c +++ b/src/core/sipe-session.c @@ -170,7 +170,8 @@ sipe_session_find_im(struct sipe_core_private *sipe_private, } SIPE_SESSION_FOREACH { - if (session->with && sipe_strcase_equal(who, session->with)) { + if (!session->is_call && + session->with && sipe_strcase_equal(who, session->with)) { return session; } } SIPE_SESSION_FOREACH_END; diff --git a/src/core/sipe-session.h b/src/core/sipe-session.h index 8ef6ec42..ddebea36 100644 --- a/src/core/sipe-session.h +++ b/src/core/sipe-session.h @@ -43,7 +43,7 @@ struct sip_session { /** chat session */ struct sipe_chat_session *chat_session; - gchar *with; /* For IM sessions only (not multi-party) . A URI.*/ + gchar *with; /* For IM or call sessions only (not multi-party) . A URI.*/ /** key is user (URI) */ GSList *dialogs; /** Key is */ -- 2.11.4.GIT