From 68d3fd47bb9b75e65859d14199ffee01f16ac9a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 10 Feb 2014 20:47:51 +0000 Subject: HCONTACT is not needed anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@8086 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/avatars.cpp | 2 +- protocols/FacebookRM/src/chat.cpp | 6 +-- protocols/FacebookRM/src/communication.cpp | 2 +- protocols/FacebookRM/src/contacts.cpp | 32 +++++++-------- protocols/FacebookRM/src/dialogs.cpp | 16 ++++---- protocols/FacebookRM/src/entities.h | 10 ++--- protocols/FacebookRM/src/events.cpp | 2 +- protocols/FacebookRM/src/json.cpp | 8 ++-- protocols/FacebookRM/src/messages.cpp | 12 +++--- protocols/FacebookRM/src/process.cpp | 14 +++---- protocols/FacebookRM/src/proto.cpp | 36 ++++++++-------- protocols/FacebookRM/src/proto.h | 66 +++++++++++++++--------------- protocols/FacebookRM/src/stubs.cpp | 28 ++++++------- protocols/FacebookRM/src/theme.cpp | 8 ++-- 14 files changed, 121 insertions(+), 121 deletions(-) (limited to 'protocols/FacebookRM/src') diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp index 8e3006a12a..358018219a 100644 --- a/protocols/FacebookRM/src/avatars.cpp +++ b/protocols/FacebookRM/src/avatars.cpp @@ -48,7 +48,7 @@ bool FacebookProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATIONT &ai, std::string * return false; } -void FacebookProto::CheckAvatarChange(HCONTACT hContact, std::string image_url) +void FacebookProto::CheckAvatarChange(MCONTACT hContact, std::string image_url) { // Facebook contacts always have some avatar - keep avatar in database even if we have loaded empty one (e.g. for 'On Mobile' contacts) if (image_url.empty()) diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 6a4884090c..52b998ca06 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -84,7 +84,7 @@ int FacebookProto::OnGCEvent(WPARAM wParam,LPARAM lParam) case GC_USER_PRIVMESS: { char* sn = mir_t2a(hook->ptszUID); - HCONTACT hContact = ContactIDToHContact(sn); + MCONTACT hContact = ContactIDToHContact(sn); mir_free(sn); CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, 0); @@ -112,7 +112,7 @@ int FacebookProto::OnGCEvent(WPARAM wParam,LPARAM lParam) case GC_USER_NICKLISTMENU: { char *sn = mir_t2a(hook->ptszUID); - HCONTACT hContact = ContactIDToHContact(sn); + MCONTACT hContact = ContactIDToHContact(sn); mir_free(sn); switch (hook->dwData) @@ -248,7 +248,7 @@ void FacebookProto::AddChat(const TCHAR *tid, const TCHAR *tname) INT_PTR FacebookProto::OnJoinChat(WPARAM wParam,LPARAM suppress) { - HCONTACT hContact = (HCONTACT)wParam; + MCONTACT hContact = (MCONTACT)wParam; // TODO: load info from server + old history,... diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index 92333f3d1f..544fb3f066 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -1252,7 +1252,7 @@ bool facebook_client::send_message(std::string message_recipient, std::string me case 1356003: // Contact is offline { - HCONTACT hContact = parent->ContactIDToHContact(message_recipient); + MCONTACT hContact = parent->ContactIDToHContact(message_recipient); if (hContact != NULL) parent->setWord(hContact, "Status", ID_STATUS_OFFLINE); return false; diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index fde9b8f678..84f30411a0 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "common.h" -void FacebookProto::SaveName(HCONTACT hContact, const facebook_user *fbu) +void FacebookProto::SaveName(MCONTACT hContact, const facebook_user *fbu) { if (fbu->real_name.empty()) { delSetting(hContact, FACEBOOK_KEY_NICK); @@ -55,7 +55,7 @@ void FacebookProto::SaveName(HCONTACT hContact, const facebook_user *fbu) } } -bool FacebookProto::IsMyContact(HCONTACT hContact, bool include_chat) +bool FacebookProto::IsMyContact(MCONTACT hContact, bool include_chat) { const char *proto = GetContactProto(hContact); if (proto && !strcmp(m_szModuleName, proto)) { @@ -66,9 +66,9 @@ bool FacebookProto::IsMyContact(HCONTACT hContact, bool include_chat) return false; } -HCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id) +MCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (!IsMyContact(hContact, true)) continue; @@ -80,9 +80,9 @@ HCONTACT FacebookProto::ChatIDToHContact(std::tstring chat_id) return 0; } -HCONTACT FacebookProto::ContactIDToHContact(std::string user_id) +MCONTACT FacebookProto::ContactIDToHContact(std::string user_id) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (!IsMyContact(hContact)) continue; @@ -98,7 +98,7 @@ std::string FacebookProto::ThreadIDToContactID(std::string thread_id) { std::string user_id; - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (!IsMyContact(hContact)) continue; @@ -138,9 +138,9 @@ std::string FacebookProto::ThreadIDToContactID(std::string thread_id) return user_id; } -HCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, bool dont_check) +MCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, bool dont_check) { - HCONTACT hContact; + MCONTACT hContact; if (!dont_check) { // First, check if this contact exists @@ -150,7 +150,7 @@ HCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, b } // If not, make a new contact! - hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); + hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if(hContact) { if(CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0) @@ -193,7 +193,7 @@ HCONTACT FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, b void FacebookProto::SetAllContactStatuses(int status) { - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (isChatRoom(hContact)) continue; @@ -228,7 +228,7 @@ void FacebookProto::DeleteContactFromServer(void *data) if (fbu != NULL) fbu->deleted = true; - HCONTACT hContact = ContactIDToHContact(id); + MCONTACT hContact = ContactIDToHContact(id); // If contact wasn't deleted from database if (hContact != NULL) { @@ -265,7 +265,7 @@ void FacebookProto::AddContactToServer(void *data) http::response resp = facy.flap(REQUEST_REQUEST_FRIEND, &query); if (resp.data.find("\"success\":true", 0) != std::string::npos) { - HCONTACT hContact = ContactIDToHContact(id); + MCONTACT hContact = ContactIDToHContact(id); // If contact wasn't deleted from database if (hContact != NULL) @@ -287,7 +287,7 @@ void FacebookProto::ApproveContactToServer(void *data) if (data == NULL) return; - HCONTACT hContact = *(HCONTACT*)data; + MCONTACT hContact = *(MCONTACT*)data; delete data; std::string post_data = "fb_dtsg=" + facy.dtsg_; @@ -310,7 +310,7 @@ void FacebookProto::CancelFriendsRequest(void *data) if (data == NULL) return; - HCONTACT hContact = *(HCONTACT*)data; + MCONTACT hContact = *(MCONTACT*)data; delete data; std::string query = "phstamp=0&confirmed=1"; @@ -370,7 +370,7 @@ void FacebookProto::SendPokeWorker(void *p) } -HANDLE FacebookProto::GetAwayMsg(HCONTACT hContact) +HANDLE FacebookProto::GetAwayMsg(MCONTACT hContact) { return 0; // Status messages are disabled } diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index e35c52f3b9..76b7f1a100 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -120,17 +120,17 @@ void RefreshPrivacy(HWND hwnd, post_status_data *data) SendDlgItemMessage(hwnd, IDC_PRIVACY, CB_SETCURSEL, data->proto->getByte(FACEBOOK_KEY_PRIVACY_TYPE, 0), 0); } -void ClistPrepare(FacebookProto *proto, HCONTACT hItem, HWND hwndList) +void ClistPrepare(FacebookProto *proto, MCONTACT hItem, HWND hwndList) { if (hItem == NULL) - hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { - HCONTACT hItemN = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + MCONTACT hItemN = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) ClistPrepare(proto, hItemT, hwndList); } @@ -143,14 +143,14 @@ void ClistPrepare(FacebookProto *proto, HCONTACT hItem, HWND hwndList) } } -void GetSelectedContacts(FacebookProto *proto, HCONTACT hItem, HWND hwndList, std::vector *contacts) +void GetSelectedContacts(FacebookProto *proto, MCONTACT hItem, HWND hwndList, std::vector *contacts) { if (hItem == NULL) - hItem = (HCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); + hItem = (MCONTACT)::SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0); while (hItem) { if (IsHContactGroup(hItem)) { - HCONTACT hItemT = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); + MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); if (hItemT) GetSelectedContacts(proto, hItemT, hwndList, contacts); } else { @@ -161,7 +161,7 @@ void GetSelectedContacts(FacebookProto *proto, HCONTACT hItem, HWND hwndList, st contacts->push_back(fu); } } - hItem = (HCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); + hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem); } } diff --git a/protocols/FacebookRM/src/entities.h b/protocols/FacebookRM/src/entities.h index 6909b6d611..14a62ef0eb 100644 --- a/protocols/FacebookRM/src/entities.h +++ b/protocols/FacebookRM/src/entities.h @@ -24,7 +24,7 @@ along with this program. If not, see . struct facebook_user { - HCONTACT handle; + MCONTACT handle; std::string user_id; std::string real_name; @@ -164,16 +164,16 @@ struct send_chat struct send_direct { - send_direct(HCONTACT hContact,const std::string &msg, HANDLE msgid) : hContact(hContact), msg(msg), msgid(msgid) {} - HCONTACT hContact; + send_direct(MCONTACT hContact,const std::string &msg, HANDLE msgid) : hContact(hContact), msg(msg), msgid(msgid) {} + MCONTACT hContact; std::string msg; HANDLE msgid; }; struct send_typing { - send_typing(HCONTACT hContact,const int status) : hContact(hContact), status(status) {} - HCONTACT hContact; + send_typing(MCONTACT hContact,const int status) : hContact(hContact), status(status) {} + MCONTACT hContact; int status; }; diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp index 81c54f3fd8..19a9c68701 100644 --- a/protocols/FacebookRM/src/events.cpp +++ b/protocols/FacebookRM/src/events.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "common.h" -void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT contact, DWORD flags, std::string *url, std::string *notification_id) +void FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWORD flags, std::string *url, std::string *notification_id) { char name[256]; diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 7fdbcbe2a8..8add178e11 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -424,7 +424,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa participant = chatroom->second.participants.find(reader_id); if (participant != chatroom->second.participants.end()) { - HCONTACT hChatContact = proto->ChatIDToHContact(tid); + MCONTACT hChatContact = proto->ChatIDToHContact(tid); const char *participant_name = participant->second.c_str(); if (!chatroom->second.message_readers.empty()) @@ -438,7 +438,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa } } } else { // classic contact - HCONTACT hContact = proto->ContactIDToHContact(json_as_pstring(reader)); + MCONTACT hContact = proto->ContactIDToHContact(json_as_pstring(reader)); if (hContact) { TCHAR ttime[64], tstr[100]; _tcsftime(ttime, SIZEOF(ttime), _T("%X"), utils::conversion::fbtime_to_timeinfo(json_as_float(time))); @@ -519,7 +519,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa } } - HCONTACT hChatContact = NULL; + MCONTACT hChatContact = NULL; // RM TODO: better use check if chatroom exists/is in db/is online... no? /// e.g. HANDLE hChatContact = proto->ChatIDToHContact(thread_id); ? @@ -627,7 +627,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa facebook_user fbu; fbu.user_id = json_as_pstring(from); - HCONTACT hContact = proto->AddToContactList(&fbu, CONTACT_FRIEND); + MCONTACT hContact = proto->AddToContactList(&fbu, CONTACT_FRIEND); if (proto->isOnline() && proto->getWord(hContact, "Status", 0) == ID_STATUS_OFFLINE) proto->setWord(hContact, "Status", ID_STATUS_ONLINE); diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index 0efbe5ea1c..fd09bfa507 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . #include "common.h" -int FacebookProto::RecvMsg(HCONTACT hContact, PROTORECVEVENT *pre) +int FacebookProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre) { ForkThread(&FacebookProto::ReadMessageWorker, (void*)hContact); CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)PROTOTYPE_CONTACTTYPING_OFF); @@ -74,7 +74,7 @@ void FacebookProto::SendChatMsgWorker(void *p) send_chat *data = static_cast(p); std::string err_message = ""; - HCONTACT hContact = ChatIDToHContact(std::tstring(_A2T(data->chat_id.c_str()))); + MCONTACT hContact = ChatIDToHContact(std::tstring(_A2T(data->chat_id.c_str()))); if (hContact) { std::string tid; DBVARIANT dbv; @@ -105,7 +105,7 @@ void FacebookProto::SendChatMsgWorker(void *p) delete data; } -int FacebookProto::SendMsg(HCONTACT hContact, int flags, const char *msg) +int FacebookProto::SendMsg(MCONTACT hContact, int flags, const char *msg) { // TODO: msg comes as Unicode (retyped wchar_t*), why should we convert it as ANSI to UTF-8? o_O if (flags & PREF_UNICODE) @@ -116,7 +116,7 @@ int FacebookProto::SendMsg(HCONTACT hContact, int flags, const char *msg) return facy.msgid_; } -int FacebookProto::UserIsTyping(HCONTACT hContact,int type) +int FacebookProto::UserIsTyping(MCONTACT hContact,int type) { if (hContact && isOnline()) ForkThread(&FacebookProto::SendTypingWorker, new send_typing(hContact, type)); @@ -166,7 +166,7 @@ void FacebookProto::ReadMessageWorker(void *p) if (p == NULL) return; - HCONTACT hContact = (HCONTACT)p; + MCONTACT hContact = (MCONTACT)p; if (getBool(FACEBOOK_KEY_KEEP_UNREAD, 0) || getBool(hContact, FACEBOOK_KEY_KEEP_UNREAD, 0)) return; @@ -184,7 +184,7 @@ void FacebookProto::ReadMessageWorker(void *p) facy.flap(REQUEST_MARK_READ, &data); } -void FacebookProto::ParseSmileys(std::string message, HCONTACT hContact) +void FacebookProto::ParseSmileys(std::string message, MCONTACT hContact) { if (!getByte(FACEBOOK_KEY_CUSTOM_SMILEYS, DEFAULT_CUSTOM_SMILEYS)) return; diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 4e0531996a..81db47063d 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -63,7 +63,7 @@ void FacebookProto::ProcessBuddyList(void* data) if (!fbu->deleted) { - HCONTACT hContact = fbu->handle; + MCONTACT hContact = fbu->handle; if (!hContact) hContact = AddToContactList(fbu, CONTACT_FRIEND); @@ -154,7 +154,7 @@ void FacebookProto::ProcessFriendList(void* data) // Check and update old contacts - for (HCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if ( isChatRoom(hContact)) continue; @@ -243,7 +243,7 @@ void FacebookProto::ProcessFriendList(void* data) facebook_user *fbu = iter->second; if (!fbu->deleted) - HCONTACT hContact = AddToContactList(fbu, CONTACT_FRIEND/*, true*/); // This contact is surely new ...am I sure? ...I'm not, so "true" is commented now + MCONTACT hContact = AddToContactList(fbu, CONTACT_FRIEND/*, true*/); // This contact is surely new ...am I sure? ...I'm not, so "true" is commented now delete fbu; } @@ -361,7 +361,7 @@ void FacebookProto::ProcessUnreadMessage(void *p) for (std::map::iterator it = chatrooms.begin(); it != chatrooms.end(); ) { facebook_chatroom *room = it->second; - HCONTACT hChatContact = NULL; + MCONTACT hChatContact = NULL; if (GetChatUsers(room->thread_id.c_str()) == NULL) { AddChat(room->thread_id.c_str(), room->chat_name.c_str()); hChatContact = ChatIDToHContact(room->thread_id); @@ -397,7 +397,7 @@ void FacebookProto::ProcessUnreadMessage(void *p) fbu.real_name = messages[i]->sender_name; // TODO: optimize this? - HCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); + MCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); setString(hContact, FACEBOOK_KEY_MESSAGE_ID, messages[i]->message_id.c_str()); // Save TID if not exists already @@ -486,7 +486,7 @@ void FacebookProto::ProcessMessages(void* data) fbu.user_id = messages[i]->user_id; fbu.real_name = messages[i]->sender_name; - HCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); + MCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); setString(hContact, FACEBOOK_KEY_MESSAGE_ID, messages[i]->message_id.c_str()); // Save TID if not exists already @@ -627,7 +627,7 @@ void FacebookProto::ProcessFriendRequests(void*) if (fbu->user_id.length() && fbu->real_name.length()) { - HCONTACT hContact = AddToContactList(fbu, CONTACT_APPROVE); + MCONTACT hContact = AddToContactList(fbu, CONTACT_APPROVE); setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_APPROVE); bool seen = false; diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index ea869c4830..7346774879 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -104,7 +104,7 @@ FacebookProto::~FacebookProto() ////////////////////////////////////////////////////////////////////////////// -DWORD_PTR FacebookProto::GetCaps(int type, HCONTACT hContact) +DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT hContact) { switch(type) { @@ -238,7 +238,7 @@ HANDLE FacebookProto::SearchByName(const PROTOCHAR* nick, const PROTOCHAR* first return SearchByEmail(arg); // Facebook is using one search method for everything (except IDs) } -HCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { ptrA id( mir_t2a_cp(psr->id, CP_UTF8)); ptrA name( mir_t2a_cp(psr->firstName, CP_UTF8)); @@ -261,7 +261,7 @@ HCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return NULL; } - HCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); + MCONTACT hContact = AddToContactList(&fbu, CONTACT_NONE); if (hContact) { if (flags & PALF_TEMPORARY) { db_set_b(hContact, "Clist", "Hidden", 1); @@ -276,7 +276,7 @@ HCONTACT FacebookProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return hContact; } -int FacebookProto::AuthRequest(HCONTACT hContact,const PROTOCHAR *message) +int FacebookProto::AuthRequest(MCONTACT hContact,const PROTOCHAR *message) { return RequestFriendship((WPARAM)hContact, NULL); } @@ -286,8 +286,8 @@ int FacebookProto::Authorize(HANDLE hDbEvent) if (!hDbEvent || isOffline()) return 1; - HCONTACT hContact = HContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; return ApproveFriendship((WPARAM)hContact, NULL); @@ -298,8 +298,8 @@ int FacebookProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR *reason) if (!hDbEvent || isOffline()) return 1; - HCONTACT hContact = HContactFromAuthEvent(hDbEvent); - if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) + MCONTACT hContact = HContactFromAuthEvent(hDbEvent); + if (hContact == INVALID_CONTACT_ID) return 1; // TODO: hide from facebook requests list @@ -450,7 +450,7 @@ INT_PTR FacebookProto::OnMind(WPARAM wParam, LPARAM lParam) if (!isOnline()) return 1; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); wall_data *wall = new wall_data(); wall->user_id = ptrA(getStringA(hContact, FACEBOOK_KEY_ID)); @@ -504,7 +504,7 @@ INT_PTR FacebookProto::RefreshBuddyList(WPARAM, LPARAM) INT_PTR FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); std::string url = FACEBOOK_URL_PROFILE; @@ -527,7 +527,7 @@ INT_PTR FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam) INT_PTR FacebookProto::VisitFriendship(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); if (wParam == 0 || !IsMyContact(hContact)) return 1; @@ -547,7 +547,7 @@ INT_PTR FacebookProto::Poke(WPARAM wParam,LPARAM lParam) if (wParam == NULL || isOffline()) return 1; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); ptrA id(getStringA(hContact, FACEBOOK_KEY_ID)); if (id == NULL) @@ -564,7 +564,7 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam,LPARAM lParam) bool deleting = (lParam == 1); - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); // Ignore groupchats and, if deleting, also not-friends if (isChatRoom(hContact) || (deleting && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0) != CONTACT_FRIEND)) @@ -601,7 +601,7 @@ INT_PTR FacebookProto::RequestFriendship(WPARAM wParam,LPARAM lParam) if (wParam == NULL || isOffline()) return 1; - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); ptrA id(getStringA(hContact, FACEBOOK_KEY_ID)); if (id == NULL) @@ -633,7 +633,7 @@ INT_PTR FacebookProto::OnCancelFriendshipRequest(WPARAM wParam,LPARAM lParam) return 0; } -HCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent) +MCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent) { DWORD body[2]; DBEVENTINFO dbei = { sizeof(dbei) }; @@ -641,13 +641,13 @@ HCONTACT FacebookProto::HContactFromAuthEvent(HANDLE hEvent) dbei.pBlob = (PBYTE)&body; if (db_event_get(hEvent, &dbei)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (dbei.eventType != EVENTTYPE_AUTHREQUEST) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; if (strcmp(dbei.szModule, m_szModuleName)) - return (HCONTACT)INVALID_HANDLE_VALUE; + return INVALID_CONTACT_ID; return DbGetAuthEventContact(&dbei); } diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index b271f62c8a..27c29883ca 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -54,31 +54,31 @@ public: __forceinline INT_PTR getStringUtf(const char *name, DBVARIANT *result) { return db_get_utf(NULL, m_szModuleName, name, result); } - __forceinline INT_PTR getStringUtf(HCONTACT hContact, const char *name, DBVARIANT *result) { + __forceinline INT_PTR getStringUtf(MCONTACT hContact, const char *name, DBVARIANT *result) { return db_get_utf(hContact, m_szModuleName, name, result); } __forceinline void setStringUtf(const char *name, const char* value) { db_set_utf(NULL, m_szModuleName, name, value); } - __forceinline void setStringUtf(HCONTACT hContact, const char *name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); } + __forceinline void setStringUtf(MCONTACT hContact, const char *name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); } //PROTO_INTERFACE - virtual HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); virtual int __cdecl Authorize(HANDLE hDbEvent); virtual int __cdecl AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason); - virtual int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl AuthRequest(HCONTACT hContact, const PROTOCHAR* szMessage); + virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl AuthRequest(MCONTACT hContact, const PROTOCHAR* szMessage); virtual HANDLE __cdecl ChangeInfo(int iInfoType, void* pInfoData); - virtual HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath); - virtual int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason); + virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath); + virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); + virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason); virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const PROTOCHAR** szFilename); - virtual DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact = NULL); - virtual int __cdecl GetInfo(HCONTACT hContact, int infoType); + virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); virtual HANDLE __cdecl SearchBasic(const PROTOCHAR* id); virtual HANDLE __cdecl SearchByEmail(const PROTOCHAR* email); @@ -86,24 +86,24 @@ public: virtual HWND __cdecl SearchAdvanced(HWND owner); virtual HWND __cdecl CreateExtendedSearchUI(HWND owner); - virtual int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT*); - virtual int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvFile(MCONTACT hContact, PROTOFILEEVENT*); + virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); + virtual int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList); - virtual HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); - virtual int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg); - virtual int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url); + virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList); + virtual HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles); + virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url); - virtual int __cdecl SetApparentMode(HCONTACT hContact, int mode); + virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode); virtual int __cdecl SetStatus(int iNewStatus); - virtual HANDLE __cdecl GetAwayMsg(HCONTACT hContact); - virtual int __cdecl RecvAwayMsg(HCONTACT hContact, int mode, PROTORECVEVENT* evt); + virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); + virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt); virtual int __cdecl SetAwayMsg(int iStatus, const PROTOCHAR* msg); - virtual int __cdecl UserIsTyping(HCONTACT hContact, int type); + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam); @@ -185,13 +185,13 @@ public: void __cdecl SendPokeWorker(void*); // Contacts handling - bool IsMyContact(HCONTACT, bool include_chat = false); - HCONTACT ContactIDToHContact(std::string); - HCONTACT ChatIDToHContact(std::tstring); + bool IsMyContact(MCONTACT, bool include_chat = false); + MCONTACT ContactIDToHContact(std::string); + MCONTACT ChatIDToHContact(std::tstring); std::string ThreadIDToContactID(std::string thread_id); - HCONTACT AddToContactList(facebook_user*, ContactType type, bool dont_check = false); + MCONTACT AddToContactList(facebook_user*, ContactType type, bool dont_check = false); void SetAllContactStatuses(int status); - HCONTACT HContactFromAuthEvent(HANDLE hEvent); + MCONTACT HContactFromAuthEvent(HANDLE hEvent); // Chats handling void AddChat(const TCHAR *id, const TCHAR *name); @@ -209,11 +209,11 @@ public: // Helpers std::tstring GetAvatarFolder(); bool GetDbAvatarInfo(PROTO_AVATAR_INFORMATIONT &ai, std::string *url); - void CheckAvatarChange(HCONTACT hContact, std::string image_url); + void CheckAvatarChange(MCONTACT hContact, std::string image_url); void ToggleStatusMenuItems(BOOL bEnable); - void ParseSmileys(std::string message, HCONTACT hContact); + void ParseSmileys(std::string message, MCONTACT hContact); void OpenUrl(std::string url); - void SaveName(HCONTACT hContact, const facebook_user *fbu); + void SaveName(MCONTACT hContact, const facebook_user *fbu); // Handles, Locks HGENMENU m_hMenuRoot, m_hMenuServicesRoot, m_hStatusMind; @@ -227,10 +227,10 @@ public: std::string last_status_msg_; HANDLE hSmileysFolder_; - std::vector avatar_queue; + std::vector avatar_queue; static void CALLBACK APC_callback(ULONG_PTR p); // Information providing - void NotifyEvent(TCHAR* title, TCHAR* info, HCONTACT contact, DWORD flags, std::string *url = NULL, std::string *notification_id = NULL); + void NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWORD flags, std::string *url = NULL, std::string *notification_id = NULL); }; diff --git a/protocols/FacebookRM/src/stubs.cpp b/protocols/FacebookRM/src/stubs.cpp index eb086a2fa8..8329a78980 100644 --- a/protocols/FacebookRM/src/stubs.cpp +++ b/protocols/FacebookRM/src/stubs.cpp @@ -22,12 +22,12 @@ along with this program. If not, see . #include "common.h" -HCONTACT FacebookProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) +MCONTACT FacebookProto::AddToListByEvent(int flags,int iContact,HANDLE hDbEvent) { return NULL; } -int FacebookProto::AuthRecv(HCONTACT hContact,PROTORECVEVENT *) +int FacebookProto::AuthRecv(MCONTACT hContact,PROTORECVEVENT *) { return 1; } @@ -38,17 +38,17 @@ HANDLE FacebookProto::ChangeInfo(int type,void *info_data) return NULL; } -HANDLE FacebookProto::FileAllow(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path) +HANDLE FacebookProto::FileAllow(MCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *path) { return NULL; } -int FacebookProto::FileCancel(HCONTACT hContact,HANDLE hTransfer) +int FacebookProto::FileCancel(MCONTACT hContact,HANDLE hTransfer) { return 1; } -int FacebookProto::FileDeny(HCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *reason) +int FacebookProto::FileDeny(MCONTACT hContact,HANDLE hTransfer,const PROTOCHAR *reason) { return 1; } @@ -58,7 +58,7 @@ int FacebookProto::FileResume(HANDLE hTransfer,int *action,const PROTOCHAR **fil return 1; } -int FacebookProto::GetInfo(HCONTACT hContact, int infoType) +int FacebookProto::GetInfo(MCONTACT hContact, int infoType) { // TODO: Most probably some ProtoAck should be here instead return 1; @@ -74,42 +74,42 @@ HWND FacebookProto::CreateExtendedSearchUI(HWND owner) return NULL; } -int FacebookProto::RecvContacts(HCONTACT hContact,PROTORECVEVENT *) +int FacebookProto::RecvContacts(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int FacebookProto::RecvFile(HCONTACT hContact,PROTORECVFILET *) +int FacebookProto::RecvFile(MCONTACT hContact,PROTORECVFILET *) { return 1; } -int FacebookProto::RecvUrl(HCONTACT hContact,PROTORECVEVENT *) +int FacebookProto::RecvUrl(MCONTACT hContact,PROTORECVEVENT *) { return 1; } -int FacebookProto::SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList) +int FacebookProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) { return 1; } -HANDLE FacebookProto::SendFile(HCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files) +HANDLE FacebookProto::SendFile(MCONTACT hContact,const PROTOCHAR *desc, PROTOCHAR **files) { return NULL; } -int FacebookProto::SendUrl(HCONTACT hContact,int flags,const char *url) +int FacebookProto::SendUrl(MCONTACT hContact,int flags,const char *url) { return 1; } -int FacebookProto::SetApparentMode(HCONTACT hContact,int mode) +int FacebookProto::SetApparentMode(MCONTACT hContact,int mode) { return 1; } -int FacebookProto::RecvAwayMsg(HCONTACT hContact,int mode,PROTORECVEVENT *evt) +int FacebookProto::RecvAwayMsg(MCONTACT hContact,int mode,PROTORECVEVENT *evt) { return 1; } diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index 61025d53d3..f9e60078ee 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -53,7 +53,7 @@ HANDLE GetIconHandle(const char* name) HGENMENU g_hContactMenuItems[CMITEMS_COUNT]; // Helper functions -static FacebookProto * GetInstanceByHContact(HCONTACT hContact) +static FacebookProto * GetInstanceByHContact(MCONTACT hContact) { char *proto = GetContactProto(hContact); if(!proto) @@ -69,7 +69,7 @@ static FacebookProto * GetInstanceByHContact(HCONTACT hContact) template INT_PTR GlobalService(WPARAM wParam,LPARAM lParam) { - FacebookProto *proto = GetInstanceByHContact(HCONTACT(wParam)); + FacebookProto *proto = GetInstanceByHContact(MCONTACT(wParam)); return proto ? (proto->*Fcn)(wParam,lParam) : 0; } @@ -78,7 +78,7 @@ static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam) for (size_t i=0; iOnPrebuildContactMenu(wParam,lParam) : 0; } @@ -152,7 +152,7 @@ void UninitContactMenus() int FacebookProto::OnPrebuildContactMenu(WPARAM wParam,LPARAM lParam) { - HCONTACT hContact = HCONTACT(wParam); + MCONTACT hContact = MCONTACT(wParam); bool bIsChatroom = isChatRoom(hContact); Menu_ShowItem(g_hContactMenuItems[CMI_VISIT_PROFILE], true); -- cgit v1.2.3