コード例 #1
0
ファイル: proto.cpp プロジェクト: martok/miranda-ng
int __cdecl CAimProto::UserIsTyping(MCONTACT hContact, int type)
{
	if (state != 1) return 0;

	if (getWord(hContact, AIM_KEY_ST, ID_STATUS_OFFLINE) == ID_STATUS_ONTHEPHONE)
		return 0;

	DBVARIANT dbv;
	if (!getBool(hContact, AIM_KEY_BLS, false) && !getString(hContact, AIM_KEY_SN, &dbv))
	{
		if (type == PROTOTYPE_SELFTYPING_ON)
			aim_typing_notification(hServerConn, seqno, dbv.pszVal, 0x0002);
		else if (type == PROTOTYPE_SELFTYPING_OFF)
			aim_typing_notification(hServerConn, seqno, dbv.pszVal, 0x0000);
		db_free(&dbv);
	}
	return 0;
}
コード例 #2
0
ファイル: services.cpp プロジェクト: truefriend-cz/miranda-ng
int CAimProto::OnWindowEvent(WPARAM, LPARAM lParam)
{
	MessageWindowEventData* msgEvData = (MessageWindowEventData*)lParam;

	if (msgEvData->uType == MSG_WINDOW_EVT_CLOSE) {
		if (m_state != 1 || !is_my_contact(msgEvData->hContact))
			return 0;

		if (getWord(msgEvData->hContact, AIM_KEY_ST, ID_STATUS_OFFLINE) == ID_STATUS_ONTHEPHONE)
			return 0;

		DBVARIANT dbv;
		if (!getBool(msgEvData->hContact, AIM_KEY_BLS, false) && !getString(msgEvData->hContact, AIM_KEY_SN, &dbv)) {
			if (_stricmp(dbv.pszVal, SYSTEM_BUDDY))
				aim_typing_notification(m_hServerConn, m_seqno, dbv.pszVal, 0x000f);
			db_free(&dbv);
		}
	}
	return 0;
}