MCONTACT CMraProto::AddToList(int flags, PROTOSEARCHRESULT *psr) { if (psr->cbSize != sizeof(PROTOSEARCHRESULT)) return 0; return AddToListByEmail(psr->email.t, psr->nick.t, psr->firstName.t, psr->lastName.t, flags); }
HANDLE __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { TCHAR *id = psr->id ? psr->id : psr->email; return AddToListByEmail( psr->flags & PSR_UNICODE ? UTF8((wchar_t*)id) : UTF8((char*)id), psr->flags & PSR_UNICODE ? UTF8((wchar_t*)psr->nick) : UTF8((char*)psr->nick), flags); }
MCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { TCHAR *id = psr->id.t ? psr->id.t : psr->email.t; return AddToListByEmail( psr->flags & PSR_UNICODE ? UTF8((wchar_t*)id) : UTF8((char*)id), psr->flags & PSR_UNICODE ? UTF8((wchar_t*)psr->nick.t) : UTF8((char*)psr->nick.t), flags); }
MCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int, MEVENT hDbEvent) { DBEVENTINFO dbei = { sizeof(dbei) }; if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1)) return NULL; dbei.pBlob = (PBYTE)alloca(dbei.cbBlob); if (db_event_get(hDbEvent, &dbei)) return NULL; if (mir_strcmp(dbei.szModule, m_szModuleName)) return NULL; if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return NULL; char* nick = (char *)(dbei.pBlob + sizeof(DWORD) * 2); char* firstName = nick + mir_strlen(nick) + 1; char* lastName = firstName + mir_strlen(firstName) + 1; char* email = lastName + mir_strlen(lastName) + 1; return AddToListByEmail(email, nick, flags); }
HANDLE __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) { DBEVENTINFO dbei = {0}; dbei.cbSize = sizeof(dbei); if ((dbei.cbBlob = MSN_CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == (DWORD)(-1)) return NULL; dbei.pBlob=(PBYTE) _malloca(dbei.cbBlob); if (MSN_CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei)) return NULL; if (strcmp(dbei.szModule, m_szModuleName)) return NULL; if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return NULL; char* nick = (char *) (dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE)); char* firstName = nick + strlen(nick) + 1; char* lastName = firstName + strlen(firstName) + 1; char* email = lastName + strlen(lastName) + 1; return AddToListByEmail(email, nick, flags); }
MCONTACT CMraProto::AddToListByEvent(int, int, MEVENT hDbEvent) { DBEVENTINFO dbei = { 0 }; dbei.cbSize = sizeof(dbei); if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) != -1) { dbei.pBlob = (PBYTE)alloca(dbei.cbBlob); if (db_event_get(hDbEvent, &dbei) == 0 && !mir_strcmp(dbei.szModule, m_szModuleName) && (dbei.eventType == EVENTTYPE_AUTHREQUEST || dbei.eventType == EVENTTYPE_CONTACTS)) { char *nick = (char*)(dbei.pBlob + sizeof(DWORD) * 2); char *firstName = nick + mir_strlen(nick) + 1; char *lastName = firstName + mir_strlen(firstName) + 1; char *email = lastName + mir_strlen(lastName) + 1; return AddToListByEmail(_A2T(email), _A2T(nick), _A2T(firstName), _A2T(lastName), 0); } } return 0; }