void WhiteboardSessionManager::handlePresenceReceived(Presence::ref presence) {
    if (!presence->isAvailable()) {
        WhiteboardSession::ref session = getSession(presence->getFrom());
        if (session) {
            session->cancel();
        }
    }
}
Exemplo n.º 2
0
    void WhiteboardManager::requestSession(const JID& contact) {
        WhiteboardSession::ref session = whiteboardSessionManager_->requestSession(contact);
        session->onSessionTerminated.connect(boost::bind(&WhiteboardManager::handleSessionTerminate, this, _1));
        session->onRequestAccepted.connect(boost::bind(&WhiteboardManager::handleSessionAccept, this, _1));
        session->onRequestRejected.connect(boost::bind(&WhiteboardManager::handleRequestReject, this, _1));

        WhiteboardWindow* window = findWhiteboardWindow(contact);
        if (window == nullptr) {
            createNewWhiteboardWindow(contact, session);
        } else {
            window->setSession(session);
        }
        onSessionRequest(session->getTo(), true);
    }
Exemplo n.º 3
0
 void WhiteboardManager::cancelSession(const JID& from) {
     WhiteboardSession::ref session = whiteboardSessionManager_->getSession(from);
     if (session) {
         session->cancel();
     }
 }