QueryBufferItem disconnect IrcUser when removing
authorShane Synan <digitalcircuit36939@gmail.com>
Wed, 27 Jul 2016 06:53:53 +0000 (02:53 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 4 Apr 2018 21:14:03 +0000 (23:14 +0200)
commit08b63f9c94aa33200d9373eadad13c130c3095b4
treee18de9a09dc3ca3388b72afa13cb6891d2c279b5
parentf8ebd4fd9a59bcb34a6ce45ce1f0b4a22beae884
QueryBufferItem disconnect IrcUser when removing

Add call to disconnect() when removing IrcUser from QueryBufferItem,
preventing _ircUser from triggering removeIrcUser() again when it's
destroyed by going out of scope.  Additionally, limit dataChanged()
to when IrcUser is removed.  May offer slight speed benefits.

Fixes at least one case of the client showing some nicknames as
offline when they're actually available (e.g. restarting the client
without restarting the core reveals them as online).

Test case from Bitlbee - receive following (no delay between AWAYs):
:nick!name@gmail.com JOIN :&bitlbee
:nick!name@gmail.com AWAY :Away (Testing)
:nick!name@gmail.com QUIT :Leaving...
:nick!name@gmail.com AWAY :User is offline

Before, 'nick' was wrongly shown as not available.  After, 'nick' is
shown as away with the message "User is offline".

(Bitlbee does this as GTalk/XMPP allow for messaging offline users)

Resolves GH-239.

(cherry picked from commit 5f81caea6345ed85a91e2d03d5a626081392d12c)
src/client/networkmodel.cpp