@@ -904,6 +904,10 @@ const char *HelpPages[] = { "MESG \n" " Displays the given message on the OSD. The message will be queued\n" " and displayed whenever this is suitable.\n", + "MSGT \n" + " Displays the given message on the OSD. First letter is used to get the\n" + " message type. Default is info. Use '%' for warning and '@' for error.\n" + " The message will be queued and displayed whenever this is suitable.\n", "MODC \n" " Modify a channel. Settings must be in the same format as returned\n" " by the LSTC command.", @@ -1086,7 +1090,8 @@ private: void CmdLSTE(const char *Option); void CmdLSTR(const char *Option); void CmdLSTT(const char *Option); - void CmdMESG(const char *Option); + void CmdMESG(const char *Option); // Message (Info) + void CmdMSGT(const char *Option); // Mesage with types void CmdMODC(const char *Option); void CmdMODT(const char *Option); void CmdMOVC(const char *Option); @@ -1992,6 +1997,24 @@ void cSVDRPServer::CmdMESG(const char *Option) Reply(501, "Missing message"); } +void cSVDRPServer::CmdMSGT(const char *Option) +{ + if (*Option) { + eMessageType Type = mtInfo; // Default + const char First = Option[0]; // First character + if (First == '%') Type = mtWarning; // Percent (#37) + else if (First == '@') Type = mtError; // At (#64) + + if (!(Type == mtInfo)) Option++; // Move the pointer one to the right + isyslog("SVDRP %s < %s message '%s'", Setup.SVDRPHostName, *clientName, Option); + Skins.QueueMessage(Type, Option); + Reply(250, "message queued"); + } + else + Reply(501, "Missing message"); +} + void cSVDRPServer::CmdMODC(const char *Option) { if (*Option) { @@ -2584,7 +2607,8 @@ void cSVDRPServer::Execute(char *Cmd) else if (CMD("LSTE")) CmdLSTE(s); else if (CMD("LSTR")) CmdLSTR(s); else if (CMD("LSTT")) CmdLSTT(s); - else if (CMD("MESG")) CmdMESG(s); + else if (CMD("MESG")) CmdMESG(s); // Message (Info) + else if (CMD("MSGT")) CmdMSGT(s); // Mesage with types else if (CMD("MODC")) CmdMODC(s); else if (CMD("MODT")) CmdMODT(s); else if (CMD("MOVC")) CmdMOVC(s);