author.Empty();
msgtext.Empty();
timestamp = time(NULL); // nb. this is Unix-specific
+ format_type = 0;
+ nodename = sock->NodeName;
// Fetch the message from the server
if (sock->serv_trans(getmsg_cmd, recvcmd, xferbuf, inRoom) != 1) {
timestamp = atol(buf.Mid(5));
else if (!key.CmpNoCase("room"))
room = buf.Mid(5);
+ else if (!key.CmpNoCase("type")) {
+ format_type = atoi(buf.Mid(5));
+ if (format_type == 1) {
+ msgtext.Append("<PRE>\n");
+ }
+ }
+ else if (!key.CmpNoCase("node"))
+ nodename = buf.Mid(5);
// Otherwise, process message text
} else {
- if ( (buf.Left(1) == " ") && (msgtext.Len() > 0) )
- msgtext.Append("<BR>");
- msgtext.Append(buf);
+ if (format_type == 1) {
+ msgtext.Append(buf);
+ msgtext.Append("\n");
+ } else {
+ if ( (buf.Left(1) == " ")
+ && (msgtext.Len() > 0) )
+ msgtext.Append("<BR>");
+ msgtext.Append(buf);
+ }
}
}
+ if (format_type == 1)
+ msgtext.Append("</PRE>\n");
}
sendcmd = "MSG0 " + buf;
message = new CitMessage(citsock, sendcmd, ThisRoom);
- allmsgs += "<i>";
+ allmsgs += " <em><font size=+1>";
allmsgs += asctime(localtime(&message->timestamp));
allmsgs += " from " + message->author;
- allmsgs += "</i><br>";
+ if (message->room.CmpNoCase(ThisRoom))
+ allmsgs += " @ " + message->room;
+ if (message->nodename.CmpNoCase(citsock->NodeName))
+ allmsgs += " @ " + message->nodename;
+ allmsgs += "</font></em><br>";
allmsgs += message->msgtext;
delete message;