From 2e2d9de08e3eb747f88cd3a9aeb750a3c34078a7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 28 Jul 2013 12:01:09 +0000 Subject: code adaptation for getTStringA git-svn-id: http://svn.miranda-ng.org/main/trunk@5508 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/contacts.cpp | 50 +++++++++++++++--------------- protocols/FacebookRM/src/dialogs.cpp | 42 ++++++++++++------------- protocols/FacebookRM/src/proto.cpp | 14 ++++----- protocols/JabberG/src/jabber_groupchat.cpp | 4 +-- protocols/JabberG/src/jabber_iqid.cpp | 10 +++--- protocols/JabberG/src/jabber_notes.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 2 +- protocols/JabberG/src/jabber_search.cpp | 2 +- protocols/JabberG/src/jabber_svc.cpp | 2 +- protocols/JabberG/src/jabber_thread.cpp | 4 +-- protocols/JabberG/src/jabber_util.cpp | 4 +-- 11 files changed, 68 insertions(+), 68 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 6f57f221aa..794455f6c2 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -79,14 +79,14 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, boo if(CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)hContact,(LPARAM)m_szModuleName) == 0) { setString(hContact, FACEBOOK_KEY_ID, fbu->user_id.c_str()); - + std::string homepage = FACEBOOK_URL_PROFILE + fbu->user_id; - setString(hContact, "Homepage", homepage.c_str()); + setString(hContact, "Homepage", homepage.c_str()); setString(hContact, "MirVer", fbu->status_id == ID_STATUS_ONTHEPHONE ? FACEBOOK_MOBILE : FACEBOOK_NAME); db_unset(hContact, "CList", "MyHandle"); - ptrT group = db_get_tsa(NULL, m_szModuleName, FACEBOOK_KEY_DEF_GROUP); + ptrT group = getTStringA(NULL, FACEBOOK_KEY_DEF_GROUP); if (group) db_set_ts(hContact, "CList", "Group", group); @@ -97,10 +97,10 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, boo if (fbu->gender) setByte(hContact, "Gender", fbu->gender); - + if (!fbu->image_url.empty()) setString(hContact, FACEBOOK_KEY_AV_URL, fbu->image_url.c_str()); - + setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, type); if (getByte(FACEBOOK_KEY_DISABLE_STATUS_NOTIFY, 0)) @@ -108,7 +108,7 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, boo return hContact; } - + CallService(MS_DB_CONTACT_DELETE,(WPARAM)hContact,0); } @@ -120,15 +120,15 @@ void FacebookProto::SetAllContactStatuses(int status, bool reset_client) for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { if (isChatRoom(hContact)) continue; - + if (reset_client) { - ptrT mirver = db_get_tsa(hContact, m_szModuleName, "MirVer"); + ptrT mirver = getTStringA(hContact, "MirVer"); if (!mirver || _tcscmp(mirver, _T(FACEBOOK_NAME))) setTString(hContact, "MirVer", _T(FACEBOOK_NAME)); /*std::tstring foldername = GetAvatarFolder() + L"\\smileys\\"; TCHAR *path = _tcsdup(foldername.c_str()); - + if (getByte(FACEBOOK_KEY_CUSTOM_SMILEYS, DEFAULT_CUSTOM_SMILEYS)) { SMADD_CONT cont; cont.cbSize = sizeof(SMADD_CONT); @@ -154,14 +154,14 @@ void FacebookProto::DeleteContactFromServer(void *data) std::string id = (*(std::string*)data); delete data; - + std::string query = "norefresh=true&unref=button_dropdown&confirmed=1&phstamp=0&__a=1"; query += "&fb_dtsg=" + facy.dtsg_; query += "&uid=" + id; - query += "&__user=" + facy.self_.user_id; + query += "&__user=" + facy.self_.user_id; std::string get_query = "norefresh=true&unref=button_dropdown&uid=" + id; - + // Get unread inbox threads http::response resp = facy.flap(REQUEST_DELETE_FRIEND, &query, &get_query); @@ -169,27 +169,27 @@ void FacebookProto::DeleteContactFromServer(void *data) facy.validate_response(&resp); if (resp.data.find("\"payload\":null", 0) != std::string::npos) - { + { facebook_user* fbu = facy.buddies.find(id); if (fbu != NULL) fbu->deleted = true; - HANDLE hContact = ContactIDToHContact(id); - + HANDLE hContact = ContactIDToHContact(id); + // If contact wasn't deleted from database if (hContact != NULL) { setWord(hContact, "Status", ID_STATUS_OFFLINE); setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_NONE); setDword(hContact, FACEBOOK_KEY_DELETED, ::time(NULL)); } - + NotifyEvent(m_tszUserName, TranslateT("Contact was removed from your server list."), NULL, FACEBOOK_EVENT_OTHER); } else { facy.client_notify(TranslateT("Error occured when removing contact from server.")); } if (resp.code != HTTP_CODE_OK) - facy.handle_error("DeleteContactFromServer"); + facy.handle_error("DeleteContactFromServer"); } void FacebookProto::AddContactToServer(void *data) @@ -201,7 +201,7 @@ void FacebookProto::AddContactToServer(void *data) std::string id = (*(std::string*)data); delete data; - + std::string query = "action=add_friend&how_found=profile_button&ref_param=ts&outgoing_id=&unwanted=&logging_location=&no_flyout_on_click=false&ego_log_data=&lsd="; query += "&fb_dtsg=" + facy.dtsg_; query += "&to_friend=" + id; @@ -214,12 +214,12 @@ void FacebookProto::AddContactToServer(void *data) facy.validate_response(&resp); if (resp.data.find("\"success\":true", 0) != std::string::npos) { - HANDLE hContact = ContactIDToHContact(id); - + HANDLE hContact = ContactIDToHContact(id); + // If contact wasn't deleted from database if (hContact != NULL) setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_REQUEST); - + NotifyEvent(m_tszUserName, TranslateT("Request for friendship was sent."), NULL, FACEBOOK_EVENT_OTHER); } else facy.client_notify(TranslateT("Error occured when requesting friendship.")); @@ -264,8 +264,8 @@ void FacebookProto::CancelFriendsRequest(void *data) HANDLE hContact = (*(HANDLE*)data); delete data; - - std::string query = "phstamp=0&confirmed=1"; + + std::string query = "phstamp=0&confirmed=1"; query += "&fb_dtsg=" + facy.dtsg_; query += "&__user=" + facy.self_.user_id; @@ -279,7 +279,7 @@ void FacebookProto::CancelFriendsRequest(void *data) facy.validate_response(&resp); if (resp.data.find("\"payload\":null", 0) != std::string::npos) - { + { setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_NONE); NotifyEvent(m_tszUserName, TranslateT("Request for friendship was canceled."), NULL, FACEBOOK_EVENT_OTHER); } @@ -311,7 +311,7 @@ void FacebookProto::SendPokeWorker(void *p) facy.validate_response(&resp); if (resp.data.find("\"payload\":null", 0) != std::string::npos) { - + std::string message = utils::text::special_expressions_decode( utils::text::remove_html( utils::text::slashu_to_utf8( diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index f1ed65eebc..a9b3ad6097 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -127,7 +127,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara SendDlgItemMessage(hwnd,IDC_MINDMSG,EM_LIMITTEXT,FACEBOOK_MIND_LIMIT,0); SendDlgItemMessage(hwnd,IDC_URL,EM_LIMITTEXT,1024,0); - ptrT place = db_get_tsa(NULL, proto->m_szModuleName, FACEBOOK_KEY_PLACE); + ptrT place = proto->getTStringA(FACEBOOK_KEY_PLACE); SetDlgItemText(hwnd, IDC_PLACE, place != NULL ? place : _T("Miranda NG")); for(size_t i=0; iForkThread(&FacebookProto::SetAwayMsgWorker, data); - EndDialog(hwnd, wparam); + EndDialog(hwnd, wparam); return TRUE; } else if (LOWORD(wparam) == IDCANCEL) @@ -262,10 +262,10 @@ INT_PTR CALLBACK FBOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp return TRUE; } - if (LOWORD(wparam) == IDC_SECURE) { + if (LOWORD(wparam) == IDC_SECURE) { EnableWindow(GetDlgItem(hwnd, IDC_SECURE_CHANNEL), IsDlgButtonChecked(hwnd, IDC_SECURE)); - } - + } + if ((LOWORD(wparam)==IDC_UN || LOWORD(wparam)==IDC_PW || LOWORD(wparam)==IDC_GROUP) && (HIWORD(wparam)!=EN_CHANGE || (HWND)lparam!=GetFocus())) return 0; @@ -297,7 +297,7 @@ INT_PTR CALLBACK FBOptionsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp StoreDBCheckState(proto, hwnd, IDC_SET_IGNORE_STATUS, FACEBOOK_KEY_DISABLE_STATUS_NOTIFY); StoreDBCheckState(proto, hwnd, IDC_BIGGER_AVATARS, FACEBOOK_KEY_BIG_AVATARS); StoreDBCheckState(proto, hwnd, IDC_LOAD_MOBILE, FACEBOOK_KEY_LOAD_MOBILE); - + return TRUE; } break; @@ -332,7 +332,7 @@ INT_PTR CALLBACK FBOptionsAdvancedProc(HWND hwnd, UINT message, WPARAM wparam, L LoadDBCheckState(proto, hwnd, IDC_LOGGING, FACEBOOK_KEY_LOGGING_ENABLE, DEFAULT_LOGGING_ENABLE); LoadDBCheckState(proto, hwnd, IDC_MAP_STATUSES, FACEBOOK_KEY_MAP_STATUSES, DEFAULT_MAP_STATUSES); LoadDBCheckState(proto, hwnd, IDC_CUSTOM_SMILEYS, FACEBOOK_KEY_CUSTOM_SMILEYS, DEFAULT_CUSTOM_SMILEYS); - + LoadDBCheckState(proto, hwnd, IDC_USE_LOCAL_TIME, FACEBOOK_KEY_LOCAL_TIMESTAMP, 0); EnableWindow(GetDlgItem(hwnd, IDC_SECURE_CHANNEL), IsDlgButtonChecked(hwnd, IDC_SECURE)); @@ -341,15 +341,15 @@ INT_PTR CALLBACK FBOptionsAdvancedProc(HWND hwnd, UINT message, WPARAM wparam, L } case WM_COMMAND: { - if (LOWORD(wparam) == IDC_SECURE) { + if (LOWORD(wparam) == IDC_SECURE) { EnableWindow(GetDlgItem(hwnd, IDC_SECURE_CHANNEL), IsDlgButtonChecked(hwnd, IDC_SECURE)); - } - + } + if (LOWORD(wparam) == IDC_SECURE_CHANNEL && IsDlgButtonChecked(hwnd, IDC_SECURE_CHANNEL)) MessageBox(hwnd, TranslateT("Note: Make sure you have disabled 'Validate SSL certificates' option in Network options to work properly."), proto->m_tszUserName, MB_OK); SendMessage(GetParent(hwnd),PSM_CHANGED,0,0); - + break; } @@ -365,7 +365,7 @@ INT_PTR CALLBACK FBOptionsAdvancedProc(HWND hwnd, UINT message, WPARAM wparam, L StoreDBCheckState(proto, hwnd, IDC_MAP_STATUSES, FACEBOOK_KEY_MAP_STATUSES); StoreDBCheckState(proto, hwnd, IDC_CUSTOM_SMILEYS, FACEBOOK_KEY_CUSTOM_SMILEYS); StoreDBCheckState(proto, hwnd, IDC_USE_LOCAL_TIME, FACEBOOK_KEY_LOCAL_TIMESTAMP); - + BOOL setStatus = IsDlgButtonChecked(hwnd, IDC_SET_STATUS); BOOL setStatusOld = proto->getByte(FACEBOOK_KEY_SET_MIRANDA_STATUS, DEFAULT_SET_MIRANDA_STATUS); if (setStatus != setStatusOld) @@ -378,7 +378,7 @@ INT_PTR CALLBACK FBOptionsAdvancedProc(HWND hwnd, UINT message, WPARAM wparam, L return TRUE; } - break; + break; } return FALSE; @@ -389,7 +389,7 @@ INT_PTR CALLBACK FBEventsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa { FacebookProto *proto = reinterpret_cast(GetWindowLongPtr(hwnd,GWLP_USERDATA)); - switch(message) + switch(message) { case WM_INITDIALOG: @@ -397,7 +397,7 @@ INT_PTR CALLBACK FBEventsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa TranslateDialogDefault(hwnd); proto = reinterpret_cast(lparam); - SetWindowLongPtr(hwnd,GWLP_USERDATA,lparam); + SetWindowLongPtr(hwnd,GWLP_USERDATA,lparam); for(size_t i=0; im_tszUserName); - proto->NotifyEvent(protoName, TranslateT("Sample event"), NULL, FACEBOOK_EVENT_CLIENT); - proto->NotifyEvent(protoName, TranslateT("Sample request"), NULL, FACEBOOK_EVENT_OTHER); - proto->NotifyEvent(protoName, TranslateT("Sample newsfeed"), NULL, FACEBOOK_EVENT_NEWSFEED); - proto->NotifyEvent(protoName, TranslateT("Sample notification"), NULL, FACEBOOK_EVENT_NOTIFICATION); + proto->NotifyEvent(protoName, TranslateT("Sample event"), NULL, FACEBOOK_EVENT_CLIENT); + proto->NotifyEvent(protoName, TranslateT("Sample request"), NULL, FACEBOOK_EVENT_OTHER); + proto->NotifyEvent(protoName, TranslateT("Sample newsfeed"), NULL, FACEBOOK_EVENT_NEWSFEED); + proto->NotifyEvent(protoName, TranslateT("Sample notification"), NULL, FACEBOOK_EVENT_NOTIFICATION); } break; case IDC_COLTEXT: @@ -476,7 +476,7 @@ INT_PTR CALLBACK FBEventsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa case WM_NOTIFY: { if (reinterpret_cast(lparam)->code == PSN_APPLY) - { + { proto->setByte(FACEBOOK_KEY_FEED_TYPE, SendDlgItemMessage(hwnd, IDC_FEED_TYPE, CB_GETCURSEL, 0, 0)); StoreDBCheckState(proto, hwnd, IDC_SYSTRAY_NOTIFY, FACEBOOK_KEY_SYSTRAY_NOTIFY); @@ -494,7 +494,7 @@ INT_PTR CALLBACK FBEventsProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa proto->setDword(FACEBOOK_KEY_EVENT_NOTIFICATIONS_COLBACK, SendDlgItemMessage(hwnd,IDC_COLBACK,CPM_GETCOLOUR,0,0)); proto->setDword(FACEBOOK_KEY_EVENT_NOTIFICATIONS_COLTEXT, SendDlgItemMessage(hwnd,IDC_COLTEXT,CPM_GETCOLOUR,0,0)); proto->setDword(FACEBOOK_KEY_EVENT_NOTIFICATIONS_TIMEOUT, GetDlgItemInt(hwnd,IDC_TIMEOUT,NULL,TRUE)); - + proto->setDword(FACEBOOK_KEY_EVENT_FEEDS_COLBACK, SendDlgItemMessage(hwnd,IDC_COLBACK2,CPM_GETCOLOUR,0,0)); proto->setDword(FACEBOOK_KEY_EVENT_FEEDS_COLTEXT, SendDlgItemMessage(hwnd,IDC_COLTEXT2,CPM_GETCOLOUR,0,0)); proto->setDword(FACEBOOK_KEY_EVENT_FEEDS_TIMEOUT, GetDlgItemInt(hwnd,IDC_TIMEOUT2,NULL,TRUE)); diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index a00e4e45e9..c4cebb6629 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -204,7 +204,7 @@ int FacebookProto::SetAwayMsg(int status, const PROTOCHAR *msg) } void FacebookProto::SetAwayMsgWorker(void *p) -{ +{ if (p != NULL) { status_data *data = static_cast(p); facy.post_status(data); @@ -544,7 +544,7 @@ INT_PTR FacebookProto::Poke(WPARAM wParam,LPARAM lParam) ptrA id(getStringA(hContact, FACEBOOK_KEY_ID)); if (id == NULL) return 1; - + ForkThread(&FacebookProto::SendPokeWorker, new std::string(id)); return 0; } @@ -562,9 +562,9 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam,LPARAM lParam) if ( isChatRoom(hContact) || (deleting && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0) != CONTACT_FRIEND)) return 0; - ptrT tname = db_get_tsa(hContact, m_szModuleName, FACEBOOK_KEY_NAME); + ptrT tname( getTStringA(hContact, FACEBOOK_KEY_NAME)); if (tname == NULL) - tname = db_get_tsa(hContact, m_szModuleName, FACEBOOK_KEY_ID); + tname = getTStringA(hContact, FACEBOOK_KEY_ID); TCHAR tstr[256]; mir_sntprintf(tstr,SIZEOF(tstr),TranslateT("Do you want to cancel your friendship with '%s'?"), tname); @@ -598,7 +598,7 @@ INT_PTR FacebookProto::RequestFriendship(WPARAM wParam,LPARAM lParam) ptrA id( getStringA(hContact, FACEBOOK_KEY_ID)); if (id == NULL) return 1; - + ForkThread(&FacebookProto::AddContactToServer, new std::string(id)); return 0; } @@ -656,7 +656,7 @@ void FacebookProto::OpenUrl(std::string url) // Make realtive url if (!isRelativeUrl) { url = url.substr(pos + facebookDomain.length()); - + // Strip eventual port pos = url.find("/"); if (pos != std::string::npos && pos != 0) @@ -684,6 +684,6 @@ void FacebookProto::ReadNotificationWorker(void *p) data += "&__user=" + facy.self_.user_id; facy.flap(REQUEST_NOTIFICATIONS_READ, NULL, &data); - + delete p; } \ No newline at end of file diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index a0655c0d27..9a7efeed41 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -867,7 +867,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *ol JABBER_RESOURCE_STATUS *r = item->findResource(oldNick); if (r == NULL) return; - + replaceStrT(r->resourceName, newNick); if ( !lstrcmp(item->nick, oldNick)) { @@ -1100,7 +1100,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) ptrT str( JabberErrorMsg(errorNode, &errorCode)); if (errorCode == JABBER_ERROR_CONFLICT) { - ptrT newNick( db_get_tsa(NULL, m_szModuleName, "GcAltNick")); + ptrT newNick( getTStringA("GcAltNick")); if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) { replaceStrT(item->nick, newNick); TCHAR text[1024] = { 0 }; diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index b45bdfe821..d36c82292d 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -331,7 +331,7 @@ void CJabberProto::OnIqResultSession(HXML iqNode, CJabberIqInfo* pInfo) void CJabberProto::GroupchatJoinByHContact(HANDLE hContact, bool autojoin) { - ptrT roomjid( db_get_tsa(hContact, m_szModuleName, "ChatRoomID")); + ptrT roomjid( getTStringA(hContact, "ChatRoomID")); if (roomjid == NULL) return; @@ -342,7 +342,7 @@ void CJabberProto::GroupchatJoinByHContact(HANDLE hContact, bool autojoin) server[0] = 0; server++; - ptrT nick( db_get_tsa(hContact, m_szModuleName, "MyNick")); + ptrT nick( getTStringA(hContact, "MyNick")); if (nick == NULL) { nick = JabberNickFromJID(m_szJabberJID); if (nick == NULL) @@ -520,7 +520,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo* pInfo) if (m_options.RosterSync == TRUE) { for (HANDLE hContact = db_find_first(m_szModuleName); hContact; ) { HANDLE hNext = db_find_next(hContact, m_szModuleName); - ptrT jid( db_get_tsa(hContact, m_szModuleName, "jid")); + ptrT jid( getTStringA(hContact, "jid")); if (jid != NULL && !ListGetItemPtr(LIST_ROSTER, jid)) { Log("Syncing roster: preparing to delete %S (hContact=0x%x)", jid, hContact); CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); @@ -1028,10 +1028,10 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode) } } if (hasFn && !hasNick) { - ptrT nick( db_get_tsa(hContact, m_szModuleName, "Nick")); + ptrT nick( getTStringA(hContact, "Nick")); ptrT jidNick( JabberNickFromJID(jid)); if (!nick || (jidNick && !_tcsicmp(nick, jidNick))) - setTString(hContact, "Nick", ptrT( db_get_tsa(hContact, m_szModuleName, "FullName"))); + setTString(hContact, "Nick", ptrT( getTStringA(hContact, "FullName"))); } if ( !hasFn) delSetting(hContact, "FullName"); diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index d442ee8a46..d0b3c9ea3f 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -854,7 +854,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleNotes(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuSendNote(WPARAM wParam, LPARAM) { if (wParam) { - CNoteItem *pItem = new CNoteItem(NULL, ptrT( db_get_tsa((HANDLE)wParam, m_szModuleName, "jid"))); + CNoteItem *pItem = new CNoteItem(NULL, ptrT( getTStringA((HANDLE)wParam, "jid"))); CJabberDlgBase *pDlg = new CJabberDlgNoteItem(this, pItem, &CJabberProto::ProcessOutgoingNote); pDlg->Show(); } diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index a17213387b..a8f61f9fb3 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -817,7 +817,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const TCHAR *szJid) numericjid = (*i >= '0') && (*i <= '9'); mir_free(szServer); - szServer = db_get_tsa(NULL, m_szModuleName, "LoginServer"); + szServer = getTStringA(NULL, "LoginServer"); if (szServer == NULL) szServer = mir_tstrdup(_T("jabber.org")); else if (numericjid && !_tcsicmp(szServer, _T("S.ms"))) { diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 342e761c2b..49f946cd42 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -702,7 +702,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent) { if (parent && hInst) { - ptrT szServer( db_get_tsa(NULL, m_szModuleName, "LoginServer")); + ptrT szServer( getTStringA("LoginServer")); if (szServer == NULL || _tcsicmp(szServer, _T("S.ms"))) return CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEARCHUSER), parent, JabberSearchAdvancedDlgProc, (LPARAM)this); } diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index c8a3bedb96..6e24c20f52 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -779,7 +779,7 @@ HANDLE CJabberSysInterface::ContactFromJID(LPCTSTR jid) LPTSTR CJabberSysInterface::ContactToJID(HANDLE hContact) { - return db_get_tsa(hContact, m_psProto->m_szModuleName, m_psProto->isChatRoom(hContact) ? "ChatRoomID" : "jid"); + return m_psProto->getTStringA(hContact, m_psProto->isChatRoom(hContact) ? "ChatRoomID" : "jid"); } LPTSTR CJabberSysInterface::GetBestResourceName(LPCTSTR jid) diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 01d13405db..deb993b7a5 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1665,7 +1665,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) Log("AvatarXVcard deleted"); setTString(hContact, "AvatarHash", ptszHash); hasAvatar = true; - ptrT saved( db_get_tsa(hContact, m_szModuleName, "AvatarSaved")); + ptrT saved( getTStringA(hContact, "AvatarSaved")); if (saved != NULL || lstrcmp(saved, ptszHash)) { Log("Avatar was changed"); ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL); @@ -1685,7 +1685,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) Log("AvatarXVcard set"); setTString(hContact, "AvatarHash", txt); hasAvatar = true; - ptrT saved( db_get_tsa(hContact, m_szModuleName, "AvatarSaved")); + ptrT saved( getTStringA(hContact, "AvatarSaved")); if (saved || lstrcmp(saved, txt)) { Log("Avatar was changed. Using vcard-temp:x:update"); ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL); diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 7f3a953551..f9d7f926e0 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -752,7 +752,7 @@ void CJabberProto::SendPresenceTo(int status, TCHAR* to, HXML extra, const TCHAR ptrA hashValue( getStringA("AvatarHash")); if (hashValue != NULL) // XEP-0153: vCard-Based Avatars x << XCHILD(_T("photo"), _A2T(hashValue)); - else + else x << XCHILD(_T("photo")); } @@ -918,7 +918,7 @@ TCHAR* CJabberProto::GetClientJID(HANDLE hContact, TCHAR *dest, size_t destLen) if (hContact == NULL) return NULL; - ptrT jid( db_get_tsa(hContact, m_szModuleName, "jid")); + ptrT jid( getTStringA(hContact, "jid")); return GetClientJID(jid, dest, destLen); } -- cgit v1.2.3