Ejemplo n.º 1
0
void LoginModule_Impl::notifyLoginDone()
{
	imcore::IMLibCoreStartOperationWithLambda(
		[]
	{
		//鑾峰彇閮ㄩ棬淇℃伅
		UInt32 lastTime = module::getSysConfigModule()->getDepartmentInfoLatestUpdateTime();
		IM::Buddy::IMDepartmentReq imDepartmentReq;
		imDepartmentReq.set_user_id(module::getSysConfigModule()->userId());
		imDepartmentReq.set_latest_update_time(lastTime);
		module::getTcpClientModule()->sendPacket(IM::BaseDefine::ServiceID::SID_BUDDY_LIST
			, IM::BaseDefine::BuddyListCmdID::CID_BUDDY_LIST_DEPARTMENT_REQUEST
			, &imDepartmentReq);
		LOG__(APP, _T("IMDepartmentReq,latest update time :%d"), lastTime);

		//澧為噺鑾峰彇鎵�鏈変汉淇℃伅
		lastTime = module::getSysConfigModule()->getUserInfoLatestUpdateTime();//鑾峰彇鏈�鍚庝竴娆℃洿鏂颁汉鍛樹俊鎭殑鏃堕棿
		IM::Buddy::IMAllUserReq imAllUserReq;
		imAllUserReq.set_user_id(module::getSysConfigModule()->userId());
		imAllUserReq.set_latest_update_time(lastTime);
		module::getTcpClientModule()->sendPacket(IM::BaseDefine::ServiceID::SID_BUDDY_LIST
			, IM::BaseDefine::BuddyListCmdID::CID_BUDDY_LIST_ALL_USER_REQUEST
			,&imAllUserReq);
		LOG__(APP, _T("IMAllUserReq,latest update time :%d"), lastTime);

		//澧為噺鑾峰彇缇ゅ垪琛�
		IM::Group::IMNormalGroupListReq imNormalGroupListReq;
		imNormalGroupListReq.set_user_id(module::getSysConfigModule()->userId());
		module::getTcpClientModule()->sendPacket(IM::BaseDefine::ServiceID::SID_GROUP
			, IM::BaseDefine::GroupCmdID::CID_GROUP_NORMAL_LIST_REQUEST
			, &imNormalGroupListReq);
		LOG__(APP, _T("IMNormalGroupListReq"));
	});
}
Ejemplo n.º 2
0
uint32_t ClientConn::getGroupList(uint32_t nUserId)
{
	CImPdu cPdu;
	IM::Group::IMNormalGroupListReq msg;
	msg.set_user_id(nUserId);
	printf("%d\n" , nUserId);
	cPdu.SetPBMsg(&msg);
    cPdu.SetServiceId(IM::BaseDefine::SID_GROUP);
    cPdu.SetCommandId(IM::BaseDefine::CID_GROUP_NORMAL_LIST_REQUEST);
    uint32_t nSeqNo = m_pSeqAlloctor->getSeq(ALLOCTOR_PACKET);
    cPdu.SetSeqNum(nSeqNo);
    SendPdu(&cPdu);
    return nSeqNo;
}