/me now formats /me properly
/me waves arms in the air like a maniac /me knocks over a nearby cup of coffee /me gasps when the coffee spills onto the adjacent laptop /me cries out “Fore! Wait, four! Wait, fire!” when the laptop bursts into flames /me burns to a crisp
This commit is contained in:
parent
4a6808f15f
commit
803a2f20bd
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Ŝarĝante…
Reference in New Issue