summaryrefslogtreecommitdiffstats
path: root/src/IrcIngameChat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/IrcIngameChat.cpp')
-rw-r--r--src/IrcIngameChat.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/IrcIngameChat.cpp b/src/IrcIngameChat.cpp
new file mode 100644
index 0000000..30e2411
--- /dev/null
+++ b/src/IrcIngameChat.cpp
@@ -0,0 +1,38 @@
+#include "IrcIngameChat.hpp"
+#include "crsm.hpp"
+
+IrcIngameChat::IrcIngameChat(const QString& channel, CRSM& crsm) : channel(channel), crsm(crsm)
+{
+
+}
+
+void IrcIngameChat::sendChannelMessage(const QString& message, bool action)
+{
+ crsm.sendIrcMessage(message, channel, action, false, false);
+}
+
+bool IrcIngameChat::clientConnected(const ClientInfo& client)
+{
+ sendChannelMessage("[Clonk] " + client.toString() + " verbunden.", false);
+ return false;
+}
+
+bool IrcIngameChat::clientMessage(ClientInfo& client, const QString& message, ClonkOutputInterface::MessageType type, const QTime& time)
+{
+ Q_UNUSED(time);
+ if(type == Action)
+ {
+ sendChannelMessage("[Clonk] " + client.nick + " " + message, true);
+ }
+ else if(type == Message)
+ {
+ sendChannelMessage("[Clonk]<" + client.nick+ "> " + message, false);
+ }
+ return false;
+}
+
+bool IrcIngameChat::clientRemoved(const ClientInfo& client, const QString& reason)
+{
+ sendChannelMessage("[Clonk] " + client.toString() + " entfernt (" + reason + ").", false);
+ return false;
+}