diff --git a/application/Conversation.cpp b/application/Conversation.cpp index f23979c..9dfa90b 100644 --- a/application/Conversation.cpp +++ b/application/Conversation.cpp @@ -166,11 +166,15 @@ Conversation::ImMessage(BMessage* msg) BString args = CommandArgs(body); ChatCommand* cmd = _GetServer()->CommandById(name, fLooper->GetInstance()); - if (cmd == NULL) { + if (cmd == NULL && name != "me") { _WarnUser(BString(B_TRANSLATE("That isn't a valid command. " "Try /help for a list."))); break; } + else { + fMessenger.SendMessage(msg); + break; + } BString error(""); if (cmd->Parse(args, &error, this) == false) diff --git a/application/views/ConversationView.cpp b/application/views/ConversationView.cpp index d33d92b..f0693a2 100644 --- a/application/views/ConversationView.cpp +++ b/application/views/ConversationView.cpp @@ -82,6 +82,7 @@ ConversationView::AttachedToWindow() } NotifyInteger(INT_WINDOW_FOCUSED, 0); fSendView->MakeFocus(true); + fSendView->Invalidate(); } @@ -433,6 +434,14 @@ ConversationView::_AppendMessage(BMessage* msg) continue; } + if (body.StartsWith("/me ")) { + BString meMsg = "** "; + meMsg << sender_name.String() << " "; + meMsg << body.RemoveFirst("/me "); + fReceiveView->AppendGeneric(meMsg.String()); + continue; + } + fReceiveView->AppendMessage(sender_name.String(), body.String(), userColor, (time_t)timeInt); }