diff --git a/src/plugins/azoth/plugins/otroid/otrhandler.cpp b/src/plugins/azoth/plugins/otroid/otrhandler.cpp index 242ed5551e..9985d7eb11 100644 --- a/src/plugins/azoth/plugins/otroid/otrhandler.cpp +++ b/src/plugins/azoth/plugins/otroid/otrhandler.cpp @@ -775,6 +775,10 @@ namespace OTRoid SIGNAL (initiateRequested (ICLEntry*, SmpMethod, QString, QString)), this, SLOT (startAuth (ICLEntry*, SmpMethod, QString, QString))); + connect (auth, + SIGNAL (destroyed ()), + this, + SLOT (handleAuthDestroyed ())); Auths_ [entry] = auth; } #endif @@ -974,6 +978,13 @@ namespace OTRoid } } + void OtrHandler::handleAuthDestroyed () + { + const auto auth = static_cast (sender ()); + const auto key = Auths_.key (auth); + Auths_.remove (key); + } + void OtrHandler::handleGotSmpReply (SmpMethod, const QString& reply, ConnContext *context) { const auto& replyUtf = reply.toUtf8 (); diff --git a/src/plugins/azoth/plugins/otroid/otrhandler.h b/src/plugins/azoth/plugins/otroid/otrhandler.h index 2a101a1ef4..462a4fd920 100644 --- a/src/plugins/azoth/plugins/otroid/otrhandler.h +++ b/src/plugins/azoth/plugins/otroid/otrhandler.h @@ -145,6 +145,7 @@ namespace OTRoid #if OTRL_VERSION_MAJOR >= 4 void handleAuthRequested (); void startAuth (ICLEntry*, SmpMethod, const QString&, const QString&); + void handleAuthDestroyed (); void handleGotSmpReply (SmpMethod, const QString&, ConnContext*); void handleAbortSmp (ConnContext*);