diff options
author | Szymon Tokarz <wsx22@o2.pl> | 2012-12-05 01:10:24 +0000 |
---|---|---|
committer | Szymon Tokarz <wsx22@o2.pl> | 2012-12-05 01:10:24 +0000 |
commit | e5602ebb20922f0ba0c9ef8fc9da03e712ddd67a (patch) | |
tree | 4e6c8e5170b275e5e91853b69228a19c7177544b /protocols/Gadu-Gadu/src/import.cpp | |
parent | 565aef440e39cf0ee2f25f689934478c979875a5 (diff) |
Gadu-Gadu protocol: account avatar work
- fixes with groupchats support
- fixed import/export contact list to text file
- Nick, MyHandle, ChatRoomID stored in db as unicode
(1st step to implement unicode support in GG protocol)
git-svn-id: http://svn.miranda-ng.org/main/trunk@2646 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/import.cpp')
-rw-r--r-- | protocols/Gadu-Gadu/src/import.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 7fd3d73b59..6de84ca6ff 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -125,18 +125,20 @@ char *gg_makecontacts(GGPROTO *gg, int cr) string_append_c(s, ';');
// Readup Nick
- if (!db_get_s(hContact, "CList", "MyHandle", &dbv, DBVT_ASCIIZ) || !db_get_s(hContact, gg->m_szModuleName, GG_KEY_NICK, &dbv, DBVT_ASCIIZ))
+ if (!db_get_s(hContact, "CList", "MyHandle", &dbv, DBVT_TCHAR) || !db_get_s(hContact, gg->m_szModuleName, GG_KEY_NICK, &dbv, DBVT_TCHAR))
{
+ char* dbvA = mir_t2a(dbv.ptszVal);
DBVARIANT dbv2;
if (!db_get_s(hContact, gg->m_szModuleName, "NickName", &dbv2, DBVT_ASCIIZ))
{
string_append(s, dbv2.pszVal);
DBFreeVariant(&dbv2);
+ } else {
+ string_append(s, dbvA);
}
- else
- string_append(s, dbv.pszVal);
string_append_c(s, ';');
- string_append(s, dbv.pszVal);
+ string_append(s, dbvA);
+ mir_free(dbvA);
DBFreeVariant(&dbv);
}
else
@@ -438,6 +440,8 @@ INT_PTR GGPROTO::import_text(WPARAM wParam, LPARAM lParam) return 0;
*pfilter = '\0';
+ *str = _T('\0');
+
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
@@ -481,8 +485,8 @@ INT_PTR GGPROTO::export_text(WPARAM wParam, LPARAM lParam) TCHAR filter[512], *pfilter;
FILE *f;
- _tcsncpy(str, TranslateT("contacts"), sizeof(str));
- _tcsncat(str, _T(".txt"), sizeof(str) - _tcslen(str));
+ _tcsncpy(str, TranslateT("contacts"), SIZEOF(str));
+ _tcsncat(str, _T(".txt"), SIZEOF(str) - _tcslen(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
_tcsncpy(filter, TranslateT("Text files"), SIZEOF(filter));
@@ -512,7 +516,7 @@ INT_PTR GGPROTO::export_text(WPARAM wParam, LPARAM lParam) ofn.lpstrDefExt = _T("txt");
#ifdef DEBUGMODE
- netlog("export_text(%s).", str);
+ netlog("export_text(%S).", str);
#endif
if (!GetSaveFileName(&ofn)) return 0;
|