本文整理汇总了C++中OnlineUserPtr::getClient方法的典型用法代码示例。如果您正苦于以下问题:C++ OnlineUserPtr::getClient方法的具体用法?C++ OnlineUserPtr::getClient怎么用?C++ OnlineUserPtr::getClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OnlineUserPtr
的用法示例。
在下文中一共展示了OnlineUserPtr::getClient方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendOnlineUserFlags
void Serializer::appendOnlineUserFlags(const OnlineUserPtr& aUser, StringSet& flags_) noexcept {
if (aUser->getIdentity().isAway()) {
flags_.insert("away");
}
if (aUser->getIdentity().isOp()) {
flags_.insert("op");
}
if (aUser->getIdentity().isBot() || aUser->getIdentity().isHub()) {
flags_.insert("bot");
}
if (aUser->isHidden()) {
flags_.insert("hidden");
}
if (aUser->supportsCCPM()) {
flags_.insert("ccpm");
}
auto cm = aUser->getIdentity().getConnectMode();
if (!aUser->getUser()->isNMDC() && (cm == Identity::MODE_NOCONNECT_PASSIVE || cm == Identity::MODE_NOCONNECT_IP || cm == Identity::MODE_UNDEFINED)) {
flags_.insert("noconnect");
} else if (!aUser->getIdentity().isTcpActive(aUser->getClient())) {
flags_.insert("passive");
}
}
示例2: checkUser
void UserManager::checkUser(const OnlineUserPtr& user)
{
if (BOOLSETTING(CHECK_NEW_USERS))
{
if (!ClientManager::getInstance()->isMe(user))
{
const Client& client = user->getClient();
if (!client.getExcludeCheck() && client.isOp() &&
(client.isActive() || user->getIdentity().isTcpActive()))
{
if (!BOOLSETTING(PROT_FAVS) || !FavoriteManager::getInstance()->isNoFavUserOrUserBanUpload(user->getUser())) // !SMT!-opt
{
if (!isInProtectedUserList(user->getIdentity().getNick()))
{
try
{
QueueManager::getInstance()->addList(HintedUser(user->getUser(), client.getHubUrl()), QueueItem::FLAG_USER_CHECK);
}
catch (const Exception& e)
{
LogManager::getInstance()->message(e.getError());
}
}
}
}
}
}
}
示例3: getStringInfo
std::string OnlineUserUtils::getStringInfo(const OnlineUserPtr& aUser, int aPropertyName) noexcept {
switch (aPropertyName) {
case HubInfo::PROP_NICK: return aUser->getIdentity().getNick();
case HubInfo::PROP_DESCRIPTION: return aUser->getIdentity().getDescription();
case HubInfo::PROP_EMAIL: return aUser->getIdentity().getEmail();
case HubInfo::PROP_TAG: return aUser->getIdentity().getTag();
case HubInfo::PROP_HUB_URL: return aUser->getHubUrl();
case HubInfo::PROP_HUB_NAME: return aUser->getClient()->getHubName();
case HubInfo::PROP_IP4: return aUser->getIdentity().getIp4();
case HubInfo::PROP_IP6: return aUser->getIdentity().getIp6();
case HubInfo::PROP_CID: return aUser->getUser()->getCID().toBase32();
default: dcassert(0); return 0;
}
}
示例4:
string OnlineUser::HubName::operator()(const OnlineUserPtr& u) {
return u->getClient()->getHubName();
}