QTfrontend/net/proto.cpp
changeset 13695 e529a34872f9
parent 11046 47a8c19ecb60
child 15909 7409084d891f
equal deleted inserted replaced
13694:91fe09213abc 13695:e529a34872f9
    45     return buf;
    45     return buf;
    46 }
    46 }
    47 
    47 
    48 QString HWProto::formatChatMsg(const QString & nick, const QString & msg)
    48 QString HWProto::formatChatMsg(const QString & nick, const QString & msg)
    49 {
    49 {
    50     if(msg.left(4) == "/me ")
    50     // Messages using the /me command.
       
    51     // Server messages (nick starts with a bracket) are never considered /me messages.
       
    52     if(msg.left(4) == "/me " && (!nick.startsWith('[')) && (!nick.startsWith('(')))
    51         return QString("\x02* %1 %2").arg(nick).arg(msg.mid(4));
    53         return QString("\x02* %1 %2").arg(nick).arg(msg.mid(4));
       
    54     // Normal chat message
    52     else
    55     else
    53         return QString("\x01%1: %2").arg(nick).arg(msg);
    56         return QString("\x01%1: %2").arg(nick).arg(msg);
    54 }
    57 }
    55 
    58 
    56 QString HWProto::chatStringToAction(const QString & string)
    59 QString HWProto::chatStringToAction(const QString & string)