RPL_INVITING (341), RPL_WHOREPLY (352), RPL_NAMREPLY (353), RPL_ENDOFWHOWAS (369)
chan->setTopic(e->params()[1]);
}
+/* RPL_WHOREPLY: "<channel> <user> <host> <server> <nick>
+ ( "H" / "G" > ["*"] [ ( "@" / "+" ) ] :<hopcount> <real name>" */
+void CoreSessionEventProcessor::processIrcEvent352(IrcEvent *e) {
+ if(!checkParamCount(e, 6))
+ return;
+
+ QString channel = e->params()[0];
+ IrcUser *ircuser = e->network()->ircUser(e->params()[4]);
+ if(ircuser) {
+ ircuser->setUser(e->params()[1]);
+ ircuser->setHost(e->params()[2]);
+
+ bool away = e->params()[5].startsWith("G");
+ ircuser->setAway(away);
+ ircuser->setServer(e->params()[3]);
+ ircuser->setRealName(e->params().last().section(" ", 1));
+ }
+
+ if(coreNetwork(e)->isAutoWhoInProgress(channel))
+ e->setFlag(EventManager::Silent);
+}
+
+/* RPL_NAMREPLY */
+void CoreSessionEventProcessor::processIrcEvent353(IrcEvent *e) {
+ if(!checkParamCount(e, 3))
+ return;
+
+ // param[0] is either "=", "*" or "@" indicating a public, private or secret channel
+ // we don't use this information at the time beeing
+ QString channelname = e->params()[1];
+
+ IrcChannel *channel = e->network()->ircChannel(channelname);
+ if(!channel) {
+ qWarning() << Q_FUNC_INFO << "Received unknown target channel:" << channelname;
+ return;
+ }
+
+ QStringList nicks;
+ QStringList modes;
+
+ foreach(QString nick, e->params()[2].split(' ')) {
+ QString mode;
+
+ if(e->network()->prefixes().contains(nick[0])) {
+ mode = e->network()->prefixToMode(nick[0]);
+ nick = nick.mid(1);
+ }
+
+ nicks << nick;
+ modes << mode;
+ }
+
+ channel->joinIrcUsers(nicks, modes);
+}
+
/* template
void CoreSessionEventProcessor::processIrcEvent(IrcEvent *e) {
if(!checkParamCount(e, 1))
Q_INVOKABLE void processIrcEvent323(IrcEvent *event); // RPL_LISTEND
Q_INVOKABLE void processIrcEvent331(IrcEvent *event); // RPL_NOTOPIC
Q_INVOKABLE void processIrcEvent332(IrcEvent *event); // RPL_TOPIC
+ Q_INVOKABLE void processIrcEvent352(IrcEvent *event); // RPL_WHOREPLY
+ Q_INVOKABLE void processIrcEvent353(IrcEvent *event); // RPL_NAMREPLY
// Q_INVOKABLE void processIrcEvent(IrcEvent *event);
.arg(e->params()[1], QDateTime::fromTime_t(e->params()[2].toInt()).toString()), QString(), channel);
}
+/* RPL_INVITING - "<nick> <channel>*/
+void EventStringifier::processIrcEvent341(IrcEvent *e) {
+ if(!checkParamCount(e, 2))
+ return;
+
+ QString channel = e->params()[1];
+ displayMsg(e, Message::Server, tr("%1 has been invited to %2").arg(e->params().first(), channel), QString(), channel);
+}
+
+/* RPL_WHOREPLY: "<channel> <user> <host> <server> <nick>
+ ( "H" / "G" > ["*"] [ ( "@" / "+" ) ] :<hopcount> <real name>" */
+void EventStringifier::processIrcEvent352(IrcEvent *e) {
+ displayMsg(e, Message::Server, tr("[Who] %1").arg(e->params().join(" ")));
+}
+
+/* RPL_ENDOFWHOWAS - "<nick> :End of WHOWAS" */
+void EventStringifier::processIrcEvent369(IrcEvent *e) {
+ displayMsg(e, Message::Server, tr("End of /WHOWAS"));
+}
+
// template
/*
Q_INVOKABLE void processIrcEvent331(IrcEvent *event); // RPL_NOTOPIC
Q_INVOKABLE void processIrcEvent332(IrcEvent *event); // RPL_TOPIC
Q_INVOKABLE void processIrcEvent333(IrcEvent *event); // RPL_??? (topic set by)
+ Q_INVOKABLE void processIrcEvent341(IrcEvent *event); // RPL_INVITING
+ Q_INVOKABLE void processIrcEvent352(IrcEvent *event); // RPL_WHOREPLY
+ Q_INVOKABLE void processIrcEvent369(IrcEvent *event); // RPL_ENDOFWHOWAS
+
// Q_INVOKABLE void processIrcEvent(IrcEvent *event);
handleMode(prefix, params);
}
-/* RPL_INVITING - "<nick> <channel>*/
-void IrcServerHandler::handle341(const QString &prefix, const QList<QByteArray> ¶ms) {
- Q_UNUSED(prefix);
- if(!checkParamCount("IrcServerHandler::handle341()", params, 2))
- return;
-
- QString nick = serverDecode(params[0]);
-
- IrcChannel *channel = network()->ircChannel(serverDecode(params[1]));
- if(!channel) {
- qWarning() << "IrcServerHandler::handle341(): unknown channel:" << params[1];
- return;
- }
-
- emit displayMsg(Message::Server, BufferInfo::ChannelBuffer, channel->name(), tr("%1 has been invited to %2").arg(nick).arg(channel->name()));
-}
-
-/* RPL_WHOREPLY: "<channel> <user> <host> <server> <nick>
- ( "H" / "G" > ["*"] [ ( "@" / "+" ) ] :<hopcount> <real name>" */
-void IrcServerHandler::handle352(const QString &prefix, const QList<QByteArray> ¶ms) {
- Q_UNUSED(prefix)
- if(!checkParamCount("IrcServerHandler::handle352()", params, 6))
- return;
-
- QString channel = serverDecode(params[0]);
- IrcUser *ircuser = network()->ircUser(serverDecode(params[4]));
- if(ircuser) {
- ircuser->setUser(serverDecode(params[1]));
- ircuser->setHost(serverDecode(params[2]));
-
- bool away = serverDecode(params[5]).startsWith("G") ? true : false;
- ircuser->setAway(away);
- ircuser->setServer(serverDecode(params[3]));
- ircuser->setRealName(serverDecode(params.last()).section(" ", 1));
- }
-
- if(!network()->isAutoWhoInProgress(channel)) {
- emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] %1").arg(serverDecode(params).join(" ")));
- }
-}
-
-/* RPL_NAMREPLY */
-void IrcServerHandler::handle353(const QString &prefix, const QList<QByteArray> ¶ms) {
- Q_UNUSED(prefix);
- if(!checkParamCount("IrcServerHandler::handle353()", params, 3))
- return;
-
- // param[0] is either "=", "*" or "@" indicating a public, private or secret channel
- // we don't use this information at the time beeing
- QString channelname = serverDecode(params[1]);
-
- IrcChannel *channel = network()->ircChannel(channelname);
- if(!channel) {
- qWarning() << "IrcServerHandler::handle353(): received unknown target channel:" << channelname;
- return;
- }
-
- QStringList nicks;
- QStringList modes;
-
- foreach(QString nick, serverDecode(params[2]).split(' ')) {
- QString mode = QString();
-
- if(network()->prefixes().contains(nick[0])) {
- mode = network()->prefixToMode(nick[0]);
- nick = nick.mid(1);
- }
-
- nicks << nick;
- modes << mode;
- }
-
- channel->joinIrcUsers(nicks, modes);
-}
-
-/* RPL_ENDOFWHOWAS - "<nick> :End of WHOWAS" */
-void IrcServerHandler::handle369(const QString &prefix, const QList<QByteArray> ¶ms) {
- Q_UNUSED(prefix)
- emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Whowas] %1").arg(serverDecode(params).join(" ")));
-}
-
/* ERR_ERRONEUSNICKNAME */
void IrcServerHandler::handle432(const QString &prefix, const QList<QByteArray> ¶ms) {
Q_UNUSED(prefix);
void handlePrivmsg(const QString &prefix, const QList<QByteArray> ¶ms);
void handleQuit(const QString &prefix, const QList<QByteArray> ¶ms);
void handle324(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_CHANNELMODEIS
- void handle341(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_INVITING
- void handle352(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_WHOREPLY
- void handle353(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_NAMREPLY
- void handle369(const QString &prefix, const QList<QByteArray> ¶ms); // RPL_ENDOFWHOWAS
void handle432(const QString &prefix, const QList<QByteArray> ¶ms); // ERR_ERRONEUSNICKNAME
void handle433(const QString &prefix, const QList<QByteArray> ¶ms); // ERR_NICKNAMEINUSE
void handle437(const QString &prefix, const QList<QByteArray> ¶ms); // ERR_UNAVAILRESOURCE