summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/Chat/ChatMessageParser.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatMessageParser.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Swift/Controllers/Chat/ChatMessageParser.cpp b/Swift/Controllers/Chat/ChatMessageParser.cpp
index c204371..d639b06 100644
--- a/Swift/Controllers/Chat/ChatMessageParser.cpp
+++ b/Swift/Controllers/Chat/ChatMessageParser.cpp
@@ -13,6 +13,7 @@
#include <boost/algorithm/string.hpp>
#include <Swiften/Base/Regex.h>
+#include <Swiften/Base/String.h>
#include <Swiften/Base/foreach.h>
#include <SwifTools/Linkify.h>
@@ -28,6 +29,11 @@ namespace Swift {
ChatWindow::ChatMessage ChatMessageParser::parseMessageBody(const std::string& body, const std::string& nick, bool senderIsSelf) {
ChatWindow::ChatMessage parsedMessage;
std::string remaining = body;
+ if (boost::starts_with(body, "/me ")) {
+ remaining = String::getSplittedAtFirst(body, ' ').second;
+ parsedMessage.setIsMeCommand(true);
+ }
+
/* Parse one, URLs */
while (!remaining.empty()) {
bool found = false;
@@ -131,8 +137,7 @@ namespace Swift {
newMessage.append(part);
}
}
- parsedMessage = newMessage;
-
+ parsedMessage.setParts(newMessage.getParts());
}
return parsedMessage;
}