//******************************/
// IRC SERVER HANDLER
//******************************/
+void IrcServerHandler::handleInvite(const QString &prefix, const QList<QByteArray> ¶ms) {
+ if(!checkParamCount("IrcServerHandler::handleInvite()", params, 2))
+ return;
+// qDebug() << "IrcServerHandler::handleInvite()" << prefix << params;
+
+ IrcUser *ircuser = network()->updateNickFromMask(prefix);
+ if(!ircuser) {
+ return;
+ }
+
+ QString channel = serverDecode(params[1]);
+
+ emit displayMsg(Message::Invite, BufferInfo::StatusBuffer, "", tr("%1 invited you to channel %2").arg(ircuser->nick()).arg(channel));
+}
+
void IrcServerHandler::handleJoin(const QString &prefix, const QList<QByteArray> ¶ms) {
if(!checkParamCount("IrcServerHandler::handleJoin()", params, 1))
return;
#ifdef HAVE_QCA2
QByteArray IrcServerHandler::decrypt(const QString &bufferName, const QByteArray &message_, bool isTopic) {
- if(bufferName.isEmpty() || message_.isEmpty())
+ if(message_.isEmpty())
return message_;
- const QByteArray key = network()->cipherKey(bufferName);
- if(key.isEmpty())
+ Cipher *cipher = network()->cipher(bufferName);
+ if(!cipher)
return message_;
QByteArray message = message_;
-
- CoreIrcChannel *channel = qobject_cast<CoreIrcChannel *>(network()->ircChannel(bufferName));
- if(channel) {
- if(channel->cipher()->setKey(key))
- message = isTopic? channel->cipher()->decryptTopic(message) : channel->cipher()->decrypt(message);
- } else {
- CoreIrcUser *user = qobject_cast<CoreIrcUser *>(network()->ircUser(bufferName));
- if(user && user->cipher()->setKey(key))
- message = user->cipher()->decrypt(message);
- }
-
+ message = isTopic? cipher->decryptTopic(message) : cipher->decrypt(message);
return message;
}
#endif