IrcEventTagmsg,
IrcEventTopic,
IrcEventError, /// ERROR message from server
+ IrcEventSetname, ///< Updated realname information
IrcEventWallops,
IrcEventRawPrivmsg, ///< Undecoded privmsg (still needs CTCP parsing)
IrcEventRawNotice, ///< Undecoded notice (still needs CTCP parsing)
*/
const QString SASL = "sasl";
+ /**
+ * Allows updating realname without reconnecting
+ *
+ * https://ircv3.net/specs/extensions/setname
+ */
+ const QString SETNAME = "setname";
+
/**
* Userhost in names replies.
*
EXTENDED_JOIN,
MULTI_PREFIX,
SASL,
+ SETNAME,
USERHOST_IN_NAMES,
SERVER_TIME,
Vendor::TWITCH_MEMBERSHIP,
}
}
+
+// IRCv3 SETNAME - ":nick!user@host SETNAME :realname goes here"
+// Example: :batman!~batman@bat.cave SETNAME :Bruce Wayne <bruce@wayne.enterprises>
+//
+// See https://ircv3.net/specs/extensions/setname
+void CoreSessionEventProcessor::processIrcEventSetname(IrcEvent* e)
+{
+ if (checkParamCount(e, 1)) {
+ IrcUser* ircuser = e->network()->updateNickFromMask(e->prefix());
+ if (!ircuser) {
+ qWarning() << Q_FUNC_INFO << "Unknown IrcUser!";
+ return;
+ }
+
+ QString newname = e->params().at(0);
+ ircuser->setRealName(newname);
+ }
+}
+
#ifdef HAVE_QCA2
void CoreSessionEventProcessor::processKeyEvent(KeyEvent* e)
{
Q_INVOKABLE void lateProcessIrcEventQuit(IrcEvent* event);
Q_INVOKABLE void processIrcEventTopic(IrcEvent* event);
Q_INVOKABLE void processIrcEventError(IrcEvent* event); /// ERROR message from server
+ Q_INVOKABLE void processIrcEventSetname(IrcEvent* event); ///< Updated realname information
#ifdef HAVE_QCA2
Q_INVOKABLE void processKeyEvent(KeyEvent* event);
#endif
#endif
}
+void CoreUserInputHandler::handleSetname(const BufferInfo& bufferInfo, const QString& msg)
+{
+ Q_UNUSED(bufferInfo)
+ emit putCmd("SETNAME", serverEncode(msg));
+}
+
void CoreUserInputHandler::handleShowkey(const BufferInfo& bufferInfo, const QString& msg)
{
QString bufname = bufferInfo.bufferName().isNull() ? "" : bufferInfo.bufferName();
void handleQuote(const BufferInfo& bufferInfo, const QString& text);
void handleSay(const BufferInfo& bufferInfo, const QString& text);
void handleSetkey(const BufferInfo& bufferInfo, const QString& text);
+ /**
+ * Handle the setname command, setting the user's realname
+ *
+ * @param bufferInfo Currently active buffer
+ * @param text New realname
+ */
+ void handleSetname(const BufferInfo& bufferInfo, const QString& text);
void handleShowkey(const BufferInfo& bufferInfo, const QString& text);
void handleTopic(const BufferInfo& bufferInfo, const QString& text);
void handleVoice(const BufferInfo& bufferInfo, const QString& text);