From ccbb811ed9ab8fe4590c29a101239b600987ba84 Mon Sep 17 00:00:00 2001
From: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
Date: Fri, 22 Jan 2016 14:59:07 -0500
Subject: [PATCH] chat: use peer contact method in recording

There was an inconsistency between in call and out of call chat
messages. In call chat messages set the ContactMethod to that of
the current account when sending a message to the peer, while out
of call messages set it to the CM of the peer. The side effect of
this was that sending an in call chat message would make a CM with
your own URI (eg: your own RingID) appear in the RecentModel
because sending a new message executes a setLastUsed() on its CM.

In order to resolve this inconsistency and the related RecentModel
bug, we now set the CM to that of the peer when sending an in call
message.

This does not lose any information as the text recording still saves
the account with which the messages were sent.

Tuleap: #259
Change-Id: I39921fd902369628f9ee68ba7ccd5667bf7f7803
---
 src/media/text.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/media/text.cpp b/src/media/text.cpp
index 6bbd7a75..412d7151 100644
--- a/src/media/text.cpp
+++ b/src/media/text.cpp
@@ -293,7 +293,7 @@ void Media::Text::send(const QMap<QString,QString>& message, const bool isMixed)
    recording();
 
    d_ptr->m_pRecording->setCall(call());
-   d_ptr->m_pRecording->d_ptr->insertNewMessage(message,call()->account()->contactMethod(),Media::Direction::OUT);
+   d_ptr->m_pRecording->d_ptr->insertNewMessage(message,call()->peerContactMethod(),Media::Direction::OUT);
 
    d_ptr->updateMimeList(message);
 
-- 
GitLab