diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-10-22 10:53:01 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-10-22 10:53:01 (GMT) |
commit | 5b22db817bfc84db5ce1956ec1cb4a6d9f98e35b (patch) | |
tree | f3f8d8a30391471e2d5ac0f7e9103e7713aa2933 /Swiften/Chat/ChatStateNotifier.cpp | |
parent | 784e8b04bc510e18a75f8f696713366bc00f3cab (diff) | |
download | swift-contrib-5b22db817bfc84db5ce1956ec1cb4a6d9f98e35b.zip swift-contrib-5b22db817bfc84db5ce1956ec1cb4a6d9f98e35b.tar.bz2 |
Don't send composing events to offline users.
Resolves: #637
Diffstat (limited to 'Swiften/Chat/ChatStateNotifier.cpp')
-rw-r--r-- | Swiften/Chat/ChatStateNotifier.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swiften/Chat/ChatStateNotifier.cpp b/Swiften/Chat/ChatStateNotifier.cpp index 667c244..1aee9cf 100644 --- a/Swiften/Chat/ChatStateNotifier.cpp +++ b/Swiften/Chat/ChatStateNotifier.cpp @@ -16,10 +16,15 @@ void ChatStateNotifier::setContactHas85Caps(bool hasCaps) { contactHas85Caps_ = hasCaps; } +void ChatStateNotifier::setContactIsOnline(bool online) { + contactIsOnline_ = online; +} + void ChatStateNotifier::contactJIDHasChanged() { contactHasSentActive_ = false; contactHas85Caps_ = false; userIsTyping_ = false; + contactIsOnline_ = false; } void ChatStateNotifier::setUserIsTyping() { @@ -50,7 +55,7 @@ bool ChatStateNotifier::contactShouldReceiveStates() { heard from the contact, the active state overrides this. *HOWEVER* it says that the MUST NOT send csn if you haven't received active is OPTIONAL behaviour for if you haven't got caps.*/ - return contactHasSentActive_ || contactHas85Caps_ ; + return contactIsOnline_ && (contactHasSentActive_ || contactHas85Caps_); } } |