Commit 11e7bafa authored by atraczyk's avatar atraczyk Committed by Andreas Traczyk

videocall: use sendTextMessage during video-call

- adds the use of SIP messages when in a call

Change-Id: Iff4cd42ac33e511d3371523ee2d909d6a3a8e2f5
Tuleap: #1206
parent e4eb5134
......@@ -98,6 +98,35 @@ void RingClientUWP::RingD::sendAccountTextMessage(String^ message)
}
}
// send message during video call
void RingClientUWP::RingD::sendSIPTextMessage(String^ message)
{
/* account id */
auto accountId = AccountsViewModel::instance->selectedAccount->accountID_;
std::wstring accountId2(accountId->Begin());
std::string accountId3(accountId2.begin(), accountId2.end());
/* call */
auto item = SmartPanelItemsViewModel::instance->_selectedItem;
auto callId = item->_callId;
std::wstring callId2(callId->Begin());
std::string callId3(callId2.begin(), callId2.end());
/* recipient */
auto contact = item->_contact;
/* payload(s) */
std::wstring message2(message->Begin());
std::string message3(message2.begin(), message2.end());
std::map<std::string, std::string> payloads;
payloads["text/plain"] = message3;
/* daemon */
DRing::sendTextMessage(callId3, payloads, accountId3, true /*not used*/);
contact->_conversation->addMessage(""/* date not yet used*/, MSG_FROM_ME, message);
contact->saveConversationToFile();
}
void
RingD::createRINGAccount(String^ alias)
{
......
......@@ -76,6 +76,7 @@ internal:
void startDaemon();
void reloadAccountList();
void sendAccountTextMessage(String^ message);
void sendSIPTextMessage(String^ message);
void createRINGAccount(String^ alias);
void createSIPAccount(String^ alias);
void refuseIncommingCall(String^ call);
......
......@@ -186,7 +186,7 @@ RingClientUWP::Views::VideoPage::sendMessage()
if (!contact || txt->IsEmpty())
return;
RingD::instance->sendAccountTextMessage(txt);
RingD::instance->sendSIPTextMessage(txt);
scrollDown();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment