Commit 37e94587 authored by Carsten Fuhrmann's avatar Carsten Fuhrmann
Browse files

fixed html tags in names,

fixed freeMemory function
parent 0d164bca
......@@ -302,6 +302,7 @@ void ts3plugin_infoData(uint64 serverConnectionHandlerID, uint64 id, enum Plugin
/* Required to release the memory for parameter "data" allocated in ts3plugin_infoData and ts3plugin_initMenus */
void ts3plugin_freeMemory(void* data) {
free(data);
}
/*
......@@ -400,17 +401,17 @@ void ts3plugin_onClientMoveEvent(uint64 serverConnectionHandlerID, anyID clientI
{
// joined my channel
if (newChannelID == getCurrentChannel(serverConnectionHandlerID))
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">entered from</font> %2</font>").arg(ClientName).arg(oldChannel));
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">entered from</font> %2</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel));
// quit my channel
else if (oldChannelID == getCurrentChannel(serverConnectionHandlerID))
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">left to</font> %2</font>").arg(ClientName).arg(newChannel));
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">left to</font> %2</font>").arg(ClientName.toHtmlEscaped()).arg(newChannel));
// somewhere else
else
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">%1 moved from %2 to %3</font>").arg(ClientName).arg(oldChannel).arg(newChannel));
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">%1 moved from %2 to %3</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel).arg(newChannel));
}
else if (!ClientName.isEmpty() && oldChannel.isEmpty() && !newChannel.isEmpty())
{
getController(serverConnectionHandlerID)->addChatLine(QString("%1 <font size=\"-5\">connected to</font> %2").arg(ClientName).arg(newChannel));
getController(serverConnectionHandlerID)->addChatLine(QString("%1 <font size=\"-5\">connected to</font> %2").arg(ClientName.toHtmlEscaped()).arg(newChannel));
}
}
......@@ -433,13 +434,13 @@ void ts3plugin_onClientMoveTimeoutEvent(uint64 serverConnectionHandlerID, anyID
{
// joined my channel
if (newChannelID == getCurrentChannel(serverConnectionHandlerID))
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">timeout from</font> %2</font>").arg(ClientName).arg(oldChannel));
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">timeout from</font> %2</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel));
// quit my channel
else if (oldChannelID == getCurrentChannel(serverConnectionHandlerID))
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">timeout to</font> %2</font>").arg(ClientName).arg(newChannel));
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">timeout to</font> %2</font>").arg(ClientName.toHtmlEscaped()).arg(newChannel));
// somewhere else
else
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">%1 timeout from %2 to %3</font>").arg(ClientName).arg(oldChannel).arg(newChannel));
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">%1 timeout from %2 to %3</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel).arg(newChannel));
}
}
......@@ -458,13 +459,13 @@ void ts3plugin_onClientMoveMovedEvent(uint64 serverConnectionHandlerID, anyID cl
{
// joined my channel
if (newChannelID == getCurrentChannel(serverConnectionHandlerID))
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">entered from</font> %2 <font size=\"-5\">by</font> %3</font>").arg(ClientName).arg(oldChannel).arg(moverName));
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">entered from</font> %2 <font size=\"-5\">by</font> %3</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel).arg(QString(moverName).toHtmlEscaped()));
// quit my channel
else if (oldChannelID == getCurrentChannel(serverConnectionHandlerID))
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">left to</font> %2 <font size=\"-5\">left by</font> %3</font>").arg(ClientName).arg(newChannel).arg(moverName));
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#00FFFF\">%1 <font size=\"-5\">left to</font> %2 <font size=\"-5\">left by</font> %3</font>").arg(ClientName.toHtmlEscaped()).arg(newChannel).arg(QString(moverName).toHtmlEscaped()));
// somewhere else
else
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">%1 moved from %2 to %3 by %4</font>").arg(ClientName).arg(oldChannel).arg(newChannel).arg(moverName));
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">%1 moved from %2 to %3 by %4</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel).arg(newChannel).arg(QString(moverName).toHtmlEscaped()));
}
}
......@@ -478,7 +479,7 @@ void ts3plugin_onClientKickFromChannelEvent(uint64 serverConnectionHandlerID, an
if (!ClientName.isEmpty() && !oldChannel.isEmpty() && !newChannel.isEmpty())
{
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#FF0000\">%1 <font size=\"-5\">was from</font> %2 <font size=\"-5\">to</font> %3 <font size=\"-5\">by</font> %4 <font size=\"-5\">because</font> %5</font>").arg(ClientName).arg(oldChannel).arg(newChannel).arg(kickerName).arg(kickMessage));
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#FF0000\">%1 <font size=\"-5\">was from</font> %2 <font size=\"-5\">to</font> %3 <font size=\"-5\">by</font> %4 <font size=\"-5\">because</font> %5</font>").arg(ClientName.toHtmlEscaped()).arg(oldChannel).arg(newChannel).arg(QString(kickerName).toHtmlEscaped()).arg(kickMessage));
}
}
......@@ -490,7 +491,7 @@ void ts3plugin_onClientKickFromServerEvent(uint64 serverConnectionHandlerID, any
if (!ClientName.isEmpty())
{
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#FF0000\">%1 <font size=\"-5\">was from Server by</font> %2 <font size=\"-5\">because</font> %3</font>").arg(ClientName).arg(kickerName).arg(kickMessage));
getController(serverConnectionHandlerID)->addChatLine(QString("<font color=\"#FF0000\">%1 <font size=\"-5\">was from Server by</font> %2 <font size=\"-5\">because</font> %3</font>").arg(ClientName.toHtmlEscaped()).arg(QString(kickerName).toHtmlEscaped()).arg(kickMessage));
}
}
......@@ -515,7 +516,7 @@ void ts3plugin_onServerStopEvent(uint64 serverConnectionHandlerID, const char* s
int ts3plugin_onTextMessageEvent(uint64 serverConnectionHandlerID, anyID targetMode, anyID toID, anyID fromID, const char* fromName, const char* fromUniqueIdentifier, const char* message, int ffIgnored) {
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">%1</font> %2").arg(fromName).arg(message));
getController(serverConnectionHandlerID)->addChatLine(QString("<font size=\"-5\">&lt;%1&gt;</font> %2").arg(QString(fromName).toHtmlEscaped()).arg(message));
return 0; /* 0 = handle normally, 1 = client will ignore the text message */
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment