void WhiteboardSessionManager::handlePresenceReceived(Presence::ref presence) { if (!presence->isAvailable()) { WhiteboardSession::ref session = getSession(presence->getFrom()); if (session) { session->cancel(); } } }
void PayloadAddingPresenceSender::sendPresence(Presence::ref presence) { if (presence->isAvailable()) { if (!presence->getTo().isValid()) { lastSentPresence = presence; } } else { lastSentPresence.reset(); } if (payload) { Presence::ref sentPresence = Presence::create(presence); sentPresence->updatePayload(payload); sender->sendPresence(sentPresence); } else { sender->sendPresence(presence); } }