void CMsnProto::MSN_StartStopTyping(ThreadData* info, bool start) { if (start && info->mTimerId == 0) { info->mTimerId = SetTimer(NULL, 0, 5000, TypingTimerProc); MSN_SendTyping(info, NULL, 1); } else if (!start && info->mTimerId != 0) { KillTimer(NULL, info->mTimerId); info->mTimerId = 0; } }
// MsnUserIsTyping - notify another contact that we're typing a message int __cdecl CMsnProto::UserIsTyping(MCONTACT hContact, int type) { if (!msnLoggedIn) return 0; char tEmail[MSN_MAX_EMAIL_LEN]; if (MSN_IsMeByContact(hContact, tEmail)) return 0; bool typing = type == PROTOTYPE_SELFTYPING_ON; int netId = Lists_GetNetId(tEmail); #ifdef OBSOLETE switch (netId) { case NETID_UNKNOWN: case NETID_MSN: case NETID_LCS: bool isOffline; { ThreadData* thread = MSN_StartSB(tEmail, isOffline); if (thread == NULL) { if (isOffline) return 0; MsgQueue_Add(tEmail, 2571, NULL, 0, NULL, typing); } else MSN_StartStopTyping(thread, typing); } break; case NETID_YAHOO: if (typing) MSN_SendTyping(msnNsThread, tEmail, netId); break; default: break; } #endif if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) MSN_SendTyping(msnNsThread, tEmail, netId, typing); return 0; }
int __cdecl CMsnProto::UserIsTyping(HANDLE hContact, int type) { if (!msnLoggedIn) return 0; char tEmail[MSN_MAX_EMAIL_LEN]; if (MSN_IsMeByContact(hContact, tEmail)) return 0; bool typing = type == PROTOTYPE_SELFTYPING_ON; int netId = Lists_GetNetId(tEmail); switch (netId) { case NETID_UNKNOWN: case NETID_MSN: case NETID_LCS: { bool isOffline; ThreadData* thread = MSN_StartSB(tEmail, isOffline); if (thread == NULL) { if (isOffline) return 0; MsgQueue_Add(tEmail, 2571, NULL, 0, NULL, typing); } else MSN_StartStopTyping(thread, typing); } break; case NETID_YAHOO: if (typing) MSN_SendTyping(msnNsThread, tEmail, netId); break; default: break; } return 0; }