本文整理汇总了C++中AccountHandler::allowsSessionTakeover方法的典型用法代码示例。如果您正苦于以下问题:C++ AccountHandler::allowsSessionTakeover方法的具体用法?C++ AccountHandler::allowsSessionTakeover怎么用?C++ AccountHandler::allowsSessionTakeover使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccountHandler
的用法示例。
在下文中一共展示了AccountHandler::allowsSessionTakeover方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _canInitiateSessionTakeover
bool AbiCollabSessionManager::_canInitiateSessionTakeover(AbiCollab* pSession)
{
UT_return_val_if_fail(pSession, false);
UT_return_val_if_fail(pSession->isLocallyControlled(), false);
const std::map<BuddyPtr, std::string> collaborators = pSession->getCollaborators();
if (collaborators.size() == 0)
return false;
/*
NOTE: for now, we only allow session takeover, if:
1. All buddies use the same account handler type
2. The account handler actually supports session takeover
3. All buddies are actually owned by the same account handler instance
Condition 1 and 2 are ok, but 3 needs fixing soon.
*/
AccountHandler* pHandler = (*collaborators.begin()).first->getHandler();
if (!pHandler->allowsSessionTakeover())
return false;
for (std::map<BuddyPtr, std::string>::const_iterator cit = ++collaborators.begin(); cit != collaborators.end(); cit++)
if (((*cit).first)->getHandler() != pHandler)
return false;
return true;
}