summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Presence/PresenceSender.cpp')
-rw-r--r--Swiften/Presence/PresenceSender.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Swiften/Presence/PresenceSender.cpp b/Swiften/Presence/PresenceSender.cpp
index 082c841..6df02b8 100644
--- a/Swiften/Presence/PresenceSender.cpp
+++ b/Swiften/Presence/PresenceSender.cpp
@@ -31,6 +31,14 @@ void PresenceSender::sendPresence(boost::shared_ptr<Presence> presence) {
}
}
+/**
+ * Gets either the last broadcast presence, or an empty stanza if none has been sent.
+ */
+boost::shared_ptr<Presence> PresenceSender::getLastSentUndirectedPresence() {
+ boost::shared_ptr<Presence> presenceCopy(lastSentUndirectedPresence ? new Presence(*lastSentUndirectedPresence) : new Presence());
+ return presenceCopy;
+}
+
void PresenceSender::addDirectedPresenceReceiver(const JID& jid) {
directedPresenceReceivers.insert(jid);
if (channel->isAvailable()) {