summaryrefslogtreecommitdiff
path: root/plugins/Non-IM Contact/src/dialog.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-10-07 18:59:19 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-10-07 18:59:19 +0000
commita5e65f02c7e37bed18fbca915e8040358d0f4fe7 (patch)
treeea9c8bfea65445c37181f77e4514cf7d98a1edcc /plugins/Non-IM Contact/src/dialog.cpp
parent419ee29ab88a47d9a87f96de040e0ce6921b83fe (diff)
Non-IM Contact:
- Minor code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@15516 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Non-IM Contact/src/dialog.cpp')
-rw-r--r--plugins/Non-IM Contact/src/dialog.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp
index 469fd1ee73..95a8552781 100644
--- a/plugins/Non-IM Contact/src/dialog.cpp
+++ b/plugins/Non-IM Contact/src/dialog.cpp
@@ -235,7 +235,7 @@ static int CALLBACK PropSheetProc(HWND, UINT uMsg, LPARAM lParam)
void DoPropertySheet(MCONTACT hContact)
{
- char title[256], nick[256];
+ char nick[256];
PROPSHEETPAGEA psp[4] = { 0 };
/* contact info */
@@ -287,9 +287,11 @@ void DoPropertySheet(MCONTACT hContact)
psh.dwFlags = PSH_USEICONID | PSH_PROPSHEETPAGE | PSH_USECALLBACK;
psh.hInstance = g_hInst;
psh.pszIcon = MAKEINTRESOURCEA(IDI_MAIN);
- db_get_static(hContact, MODNAME, "Nick", nick, _countof(nick));
- mir_snprintf(title, Translate("Edit Non-IM Contact \"%s\""), nick);
- psh.pszCaption = title;
+ if (!db_get_static(hContact, MODNAME, "Nick", nick, _countof(nick))) {
+ char title[256];
+ mir_snprintf(title, Translate("Edit Non-IM Contact \"%s\""), nick);
+ psh.pszCaption = title;
+ }
psh.nPages = _countof(psp);
psh.ppsp = (LPCPROPSHEETPAGEA)&psp;
psh.pfnCallback = PropSheetProc;
@@ -306,7 +308,7 @@ INT_PTR addContact(WPARAM, LPARAM)
CallService(MS_IGNORE_IGNORE, hContact, IGNOREEVENT_USERONLINE);
db_set_ts(hContact, MODNAME, "Nick", TranslateT("New Non-IM Contact"));
DoPropertySheet(hContact);
- if (!db_get_static(hContact, MODNAME, "Name", tmp, _countof(tmp)))
+ if (db_get_static(hContact, MODNAME, "Name", tmp, _countof(tmp)))
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
replaceAllStrings(hContact);
return 0;
@@ -323,7 +325,7 @@ INT_PTR editContact(WPARAM wParam, LPARAM)
db_set_s(hContact, MODNAME, "Nick", Translate("New Non-IM Contact"));
}
DoPropertySheet(hContact);
- if (!db_get_static(hContact, MODNAME, "Name", tmp, _countof(tmp)))
+ if (db_get_static(hContact, MODNAME, "Name", tmp, _countof(tmp)))
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
replaceAllStrings(hContact);
return 0;