callbackshandler: handle @ring.dht uri for all contacts

And be prepared to sha256

Change-Id: Ib2338034ba9e362f9b129d09728929a3fd85c703
parent db54e18b
...@@ -256,7 +256,7 @@ CallbacksHandler::slotNewAccountMessage(const QString& accountId, ...@@ -256,7 +256,7 @@ CallbacksHandler::slotNewAccountMessage(const QString& accountId,
} }
auto accountId2 = accountId.toStdString(); auto accountId2 = accountId.toStdString();
auto from2 = from.toStdString(); auto from2 = QString(from).replace("@ring.dht", "").toStdString();
emit newAccountMessage(accountId2, from2, stdPayloads); emit newAccountMessage(accountId2, from2, stdPayloads);
} }
...@@ -385,10 +385,9 @@ CallbacksHandler::slotIncomingMessage(const QString& callId, ...@@ -385,10 +385,9 @@ CallbacksHandler::slotIncomingMessage(const QString& callId,
const QMap<QString,QString>& interaction) const QMap<QString,QString>& interaction)
{ {
std::string from2; std::string from2;
if (from.contains("ring.dht")) { if (from.contains("@ring.dht")) {
from2 = from.left(40).toStdString(); from2 = QString(from).replace("@ring.dht", "").toStdString();
} } else {
else {
auto left = from.indexOf(":")+1; auto left = from.indexOf(":")+1;
auto right = from.indexOf("@"); auto right = from.indexOf("@");
from2 = from.mid(left, right-left).toStdString(); from2 = from.mid(left, right-left).toStdString();
......
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