diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-29 16:24:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-29 16:24:44 +0000 |
commit | 518e9a70f554179f344510f594d7d759b56cea58 (patch) | |
tree | c1e952b455e38e5ab2ee92a8868afc34f51364ed /protocols/WhatsApp/src/contacts.cpp | |
parent | 25a7a059a20f51e6df201ba606e38c4aef45e8f0 (diff) |
fix for the automatic nick name extraction
git-svn-id: http://svn.miranda-ng.org/main/trunk@11951 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/contacts.cpp')
-rw-r--r-- | protocols/WhatsApp/src/contacts.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 0250420ed2..487afc6321 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -28,9 +28,10 @@ MCONTACT WhatsAppProto::AddToContactList(const std::string& jid, BYTE , bool don oldName = dbv.pszVal;
db_free(&dbv);
}
- db_set_utf(hContact, m_szModuleName, WHATSAPP_KEY_NICK, new_name);
if (oldName.compare(string(new_name)) != 0) {
+ db_set_utf(hContact, m_szModuleName, WHATSAPP_KEY_NICK, new_name);
+
CMString tmp(FORMAT, TranslateT("is now known as '%s'"), ptrT(mir_utf8decodeT(new_name)));
this->NotifyEvent(_A2T(oldName.c_str()), tmp, hContact, WHATSAPP_EVENT_OTHER);
}
@@ -496,13 +497,10 @@ INT_PTR __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM hContact, LPARAM lPar {
input_box* ib = new input_box;
- DBVARIANT dbv;
- if (getTString(hContact, WHATSAPP_KEY_NICK, &dbv))
- ib->defaultValue = _T("");
- else {
- ib->defaultValue = dbv.ptszVal;
- db_free(&dbv);
- }
+ ptrT szNick(getTStringA(hContact, WHATSAPP_KEY_NICK));
+ if (szNick != NULL)
+ ib->defaultValue = szNick;
+
ib->limit = WHATSAPP_GROUP_NAME_LIMIT;
ib->text = _T("Enter new group subject");
ib->title = _T("WhatsApp - Change Group Subject");
|