コード例 #1
0
void WhiteboardSessionManager::handlePresenceReceived(Presence::ref presence) {
    if (!presence->isAvailable()) {
        WhiteboardSession::ref session = getSession(presence->getFrom());
        if (session) {
            session->cancel();
        }
    }
}
コード例 #2
0
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);
    }
}