From a24dc912bfcf52daa0086aeee1073f0f74b2bad9 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Wed, 28 Oct 2020 20:53:28 +0100 Subject: RosterManager: Cache roster when using stream management The roster manager caches the roster items if a previous stream could be resumed now. The rosterReceived() signal is not emitted again in this case. This avoids redundant roster requests. When no stream management is used, the roster cache is cleared directly on disconnecting. If stream management is used, the cache is also accessible after disconnecting. On connecting the manager checks whether the last stream could be resumed. If the last stream hasn't been resumed, the cache is cleared and the roster is re-requested. --- src/client/QXmppRosterManager.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/client/QXmppRosterManager.h') diff --git a/src/client/QXmppRosterManager.h b/src/client/QXmppRosterManager.h index c91d05f2..90022edb 100644 --- a/src/client/QXmppRosterManager.h +++ b/src/client/QXmppRosterManager.h @@ -101,6 +101,10 @@ Q_SIGNALS: /// connection. That is the roster entries are empty before this signal is emitted. /// One should use getRosterBareJids() and getRosterEntry() only after /// this signal has been emitted. + /// + /// \note If the previous stream could be resumed, this signal is not + /// emitted since QXmpp 1.4. Changes since the last connection are reported + /// via the itemAdded(), itemChanged() and itemRemoved() signals. void rosterReceived(); /// This signal is emitted when the presence of a particular bareJid and resource changes. -- cgit v1.2.3