From 3daa3810774b6f8f1a4d557859bcf2ad6a039395 Mon Sep 17 00:00:00 2001 From: HanzZ Date: Sun, 11 Sep 2011 18:00:25 +0200 Subject: [PATCH] Send proper from when buddy is not in roster --- src/conversation.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conversation.cpp b/src/conversation.cpp index cd146a21..601ce907 100644 --- a/src/conversation.cpp +++ b/src/conversation.cpp @@ -59,7 +59,11 @@ void Conversation::handleMessage(boost::shared_ptr &message, con message->setFrom(buddy->getJID()); } else { - // TODO: escape from and setFrom + std::string name = nickname; + if (name.find_last_of("@") != std::string::npos) { + name.replace(name.find_last_of("@"), 1, "%"); + } + message->setFrom(name); } } // PM message