INT_PTR TwitterProto::OnJoinChat(WPARAM, LPARAM suppress) { // ***** Create the group chat session GCSESSION gcw = { sizeof(gcw) }; gcw.iType = GCW_CHATROOM; gcw.pszModule = m_szModuleName; gcw.ptszName = m_tszUserName; gcw.ptszID = m_tszUserName; CallServiceSync(MS_GC_NEWSESSION, 0, (LPARAM)&gcw); if (m_iStatus != ID_STATUS_ONLINE) return 0; // ***** Create a group GCDEST gcd = { m_szModuleName, m_tszUserName, GC_EVENT_ADDGROUP }; GCEVENT gce = { sizeof(gce), &gcd }; gce.ptszStatus = _T("Normal"); CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce)); // ***** Hook events HookProtoEvent(ME_GC_EVENT, &TwitterProto::OnChatOutgoing); // Note: Initialization will finish up in SetChatStatus, called separately if (!suppress) SetChatStatus(m_iStatus); in_chat_ = true; return 0; }
void TwitterProto::SetAllContactStatuses(int status) { for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) if (!getByte(hContact, "ChatRoom")) setWord(hContact, "Status", (WORD)status); SetChatStatus(status); }