+
+void CoreUserInputHandler::handleKick(const BufferInfo &bufferInfo, const QString &msg)
+{
+ QString nick = msg.section(' ', 0, 0, QString::SectionSkipEmpty);
+ QString reason = msg.section(' ', 1, -1, QString::SectionSkipEmpty).trimmed();
+ if (reason.isEmpty())
+ reason = network()->identityPtr()->kickReason();
+
+ QList<QByteArray> params;
+ params << serverEncode(bufferInfo.bufferName()) << serverEncode(nick) << channelEncode(bufferInfo.bufferName(), reason);
+ emit putCmd("KICK", params);
+}
+
+
+void CoreUserInputHandler::handleKill(const BufferInfo &bufferInfo, const QString &msg)
+{
+ Q_UNUSED(bufferInfo)
+ QString nick = msg.section(' ', 0, 0, QString::SectionSkipEmpty);
+ QString pass = msg.section(' ', 1, -1, QString::SectionSkipEmpty);
+ QList<QByteArray> params;
+ params << serverEncode(nick) << serverEncode(pass);
+ emit putCmd("KILL", params);
+}
+
+
+void CoreUserInputHandler::handleList(const BufferInfo &bufferInfo, const QString &msg)
+{
+ Q_UNUSED(bufferInfo)
+ emit putCmd("LIST", serverEncode(msg.split(' ', QString::SkipEmptyParts)));
+}
+
+
+void CoreUserInputHandler::handleMe(const BufferInfo &bufferInfo, const QString &msg)
+{
+ if (bufferInfo.bufferName().isEmpty() || !bufferInfo.acceptsRegularMessages())
+ return; // server buffer
+ // FIXME make this a proper event
+ coreNetwork()->coreSession()->ctcpParser()->query(coreNetwork(), bufferInfo.bufferName(), "ACTION", msg);
+ emit displayMsg(Message::Action, bufferInfo.type(), bufferInfo.bufferName(), msg, network()->myNick(), Message::Self);
+}
+
+
+void CoreUserInputHandler::handleMode(const BufferInfo &bufferInfo, const QString &msg)
+{
+ Q_UNUSED(bufferInfo)
+
+ QStringList params = msg.split(' ', QString::SkipEmptyParts);
+ // if the first argument is neither a channel nor us (user modes are only to oneself) the current buffer is assumed to be the target
+ if (!params.isEmpty()) {
+ if (!network()->isChannelName(params[0]) && !network()->isMyNick(params[0]))
+ params.prepend(bufferInfo.bufferName());
+ if (network()->isMyNick(params[0]) && params.count() == 2)
+ network()->updateIssuedModes(params[1]);
+ if (params[0] == "-reset" && params.count() == 1) {
+ // FIXME: give feedback to the user (I don't want to add new strings right now)
+ network()->resetPersistentModes();
+ return;
+ }
+ }
+
+ // TODO handle correct encoding for buffer modes (channelEncode())
+ emit putCmd("MODE", serverEncode(params));
+}
+
+