summaryrefslogtreecommitdiff
path: root/plugins/DbEditorPP/src/copymodule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/DbEditorPP/src/copymodule.cpp')
-rw-r--r--plugins/DbEditorPP/src/copymodule.cpp79
1 files changed, 21 insertions, 58 deletions
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp
index 4bc2b21f4c..28ee01a696 100644
--- a/plugins/DbEditorPP/src/copymodule.cpp
+++ b/plugins/DbEditorPP/src/copymodule.cpp
@@ -65,68 +65,35 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
}
// contacts name
- if (UOS)
- {
- DBVARIANT dbv ={0};
- WCHAR nick[256];
- WCHAR protoW[256]; // unicode proto
+ DBVARIANT dbv ={0};
+ WCHAR nick[256];
+ WCHAR protoW[256]; // unicode proto
- if (szProto[0])
- a2u(szProto, protoW, SIZEOF(protoW));
- else
- protoW[0] = 0;
+ if (szProto[0])
+ a2u(szProto, protoW, SIZEOF(protoW));
+ else
+ protoW[0] = 0;
- if (!szProto[0] || !loaded)
- {
- if (protoW)
- {
- if (Order)
- mir_snwprintf(nick, SIZEOF(nick), L"(%s) %s %s", protoW, GetContactName(hContact, szProto, 1), L"(UNLOADED)");
- else
- mir_snwprintf(nick, SIZEOF(nick), L"%s (%s) %s", GetContactName(hContact, szProto, 1), protoW, L"(UNLOADED)");
- }
- else
- wcscpy(nick, nick_unknownW);
- }
- else
- {
+ if (!szProto[0] || !loaded) {
+ if (protoW) {
if (Order)
- mir_snwprintf(nick, SIZEOF(nick), L"(%s) %s", protoW, GetContactName(hContact, szProto, 1));
+ mir_snwprintf(nick, SIZEOF(nick), L"(%s) %s %s", protoW, GetContactName(hContact, szProto, 1), L"(UNLOADED)");
else
- mir_snwprintf(nick, SIZEOF(nick), L"%s (%s)", GetContactName(hContact, szProto, 1), protoW);
+ mir_snwprintf(nick, SIZEOF(nick), L"%s (%s) %s", GetContactName(hContact, szProto, 1), protoW, L"(UNLOADED)");
}
-
- index = SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_ADDSTRING, 0, (LPARAM)nick);
- SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, (LPARAM)hContact);
+ else
+ wcscpy(nick, nick_unknownW);
}
- else
- {
- char nick[256];
-
- if (!szProto[0] || !loaded)
- {
- if (szProto[0])
- {
- if (Order)
- mir_snprintf(nick, SIZEOF(nick), "(%s) %s %s", szProto, (char*)GetContactName(hContact, szProto, 0), "(UNLOADED)");
- else
- mir_snprintf(nick, SIZEOF(nick), "%s (%s) %s", (char*)GetContactName(hContact, szProto, 0), szProto, "(UNLOADED)");
- }
- else
- strcpy(nick, nick_unknown);
- }
+ else {
+ if (Order)
+ mir_snwprintf(nick, SIZEOF(nick), L"(%s) %s", protoW, GetContactName(hContact, szProto, 1));
else
- {
- if (Order)
- mir_snprintf(nick, SIZEOF(nick), "(%s) %s", szProto, (char*)GetContactName(hContact, szProto, 0));
- else
- mir_snprintf(nick, SIZEOF(nick), "%s (%s)", (char*)GetContactName(hContact, szProto, 0), szProto);
- }
-
- index = SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_ADDSTRING, 0, (LPARAM)nick);
- SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, (LPARAM)hContact);
+ mir_snwprintf(nick, SIZEOF(nick), L"%s (%s)", GetContactName(hContact, szProto, 1), protoW);
}
+ index = SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_ADDSTRING, 0, (LPARAM)nick);
+ SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, (LPARAM)hContact);
+
hContact = db_find_next(hContact);
}
@@ -185,13 +152,9 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
void copyModuleMenuItem(char* module, HANDLE hContact)
{
- HWND hwnd;
ModuleAndContact *mac = (ModuleAndContact *)mir_calloc(sizeof(ModuleAndContact));
mac->hContact = hContact;
strncpy(mac->module, module, 255);
- if (UOS)
- hwnd = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_COPY_MOD), 0, copyModDlgProc, (LPARAM)mac);
- else
- hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_COPY_MOD), 0, copyModDlgProc, (LPARAM)mac);
+ CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_COPY_MOD), 0, copyModDlgProc, (LPARAM)mac);
} \ No newline at end of file