INT_PTR CMsnProto::MsnSendNetMeeting(WPARAM wParam, LPARAM) { if (!msnLoggedIn) return 0; MCONTACT hContact = MCONTACT(wParam); char szEmail[MSN_MAX_EMAIL_LEN]; if (MSN_IsMeByContact(hContact, szEmail)) return 0; ThreadData* thread = MSN_GetThreadByContact(szEmail); if (thread == NULL) { MessageBox(NULL, TranslateT("You must be talking to start Netmeeting"), TranslateT("MSN Protocol"), MB_OK | MB_ICONERROR); return 0; } char msg[1024]; mir_snprintf(msg, _countof(msg), "Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n" "Application-Name: NetMeeting\r\n" "Application-GUID: {44BBA842-CC51-11CF-AAFA-00AA00B6015C}\r\n" "Session-Protocol: SM1\r\n" "Invitation-Command: INVITE\r\n" "Invitation-Cookie: %i\r\n" "Session-ID: {1A879604-D1B8-11D7-9066-0003FF431510}\r\n\r\n", MSN_GenRandom()); thread->sendMessage('N', NULL, 1, msg, MSG_DISABLE_HDR); return 0; }
HANDLE __cdecl CMsnProto::GetAwayMsg(HANDLE hContact) { AwayMsgInfo* inf = (AwayMsgInfo*)mir_alloc(sizeof(AwayMsgInfo)); inf->hContact = hContact; inf->id = MSN_GenRandom(); ForkThread(&CMsnProto::MsnGetAwayMsgThread, inf); return (HANDLE)inf->id; }
unsigned CMsnProto::p2p_getMsgId(const char* wlid, int inc) { EnterCriticalSection(&csLists); MsnPlace* p = Lists_GetPlace(wlid); unsigned res = p && p->p2pMsgId ? p->p2pMsgId : MSN_GenRandom(); if (p) p->p2pMsgId = res + inc; LeaveCriticalSection(&csLists); return res; }
unsigned CMsnProto::p2p_getMsgId(const char* wlid, int inc) { mir_cslock lck(m_csLists); MsnPlace *p = Lists_GetPlace(wlid); unsigned res = p && p->p2pMsgId ? p->p2pMsgId : MSN_GenRandom(); if (p) p->p2pMsgId = res + inc; return res; }