本文整理汇总了C++中CImUser::BroadcastPduToMobile方法的典型用法代码示例。如果您正苦于以下问题:C++ CImUser::BroadcastPduToMobile方法的具体用法?C++ CImUser::BroadcastPduToMobile怎么用?C++ CImUser::BroadcastPduToMobile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CImUser
的用法示例。
在下文中一共展示了CImUser::BroadcastPduToMobile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _HandlePCLoginStatusNotify
void CRouteServConn::_HandlePCLoginStatusNotify(CImPdu *pPdu)
{
IM::Server::IMServerPCLoginStatusNotify msg;
CHECK_PB_PARSE_MSG(msg.ParseFromArray(pPdu->GetBodyData(), pPdu->GetBodyLength()));
uint32_t user_id = msg.user_id();
uint32_t login_status = msg.login_status();
log("HandlePCLoginStatusNotify, user_id=%u, login_status=%u ", user_id, login_status);
CImUser* pUser = CImUserManager::GetInstance()->GetImUserById(user_id);
if (pUser)
{
pUser->SetPCLoginStatus(login_status);
IM::Buddy::IMPCLoginStatusNotify msg2;
msg2.set_user_id(user_id);
if (IM_PC_LOGIN_STATUS_ON == login_status)
{
msg2.set_login_stat(::IM::BaseDefine::USER_STATUS_ONLINE);
}
else
{
msg2.set_login_stat(::IM::BaseDefine::USER_STATUS_OFFLINE);
}
CImPdu pdu;
pdu.SetPBMsg(&msg2);
pdu.SetServiceId(IM::BaseDefine::SID_BUDDY_LIST);
pdu.SetCommandId(IM::BaseDefine::CID_BUDDY_LIST_PC_LOGIN_STATUS_NOTIFY);
pUser->BroadcastPduToMobile(&pdu);
}
}
示例2: BroadcastPdu
void CImUserManager::BroadcastPdu(CImPdu* pdu, uint32_t client_type_flag)
{
CImUser* pImUser = NULL;
for (ImUserMap_t::iterator it = m_im_user_map.begin(); it != m_im_user_map.end(); it++)
{
pImUser = (CImUser*)it->second;
if (pImUser->IsValidate())
{
switch (client_type_flag) {
case CLIENT_TYPE_FLAG_PC:
pImUser->BroadcastPduWithOutMobile(pdu);
break;
case CLIENT_TYPE_FLAG_MOBILE:
pImUser->BroadcastPduToMobile(pdu);
break;
case CLIENT_TYPE_FLAG_BOTH:
pImUser->BroadcastPdu(pdu);
break;
default:
break;
}
}
}
}