diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-04-21 18:38:42 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-04-21 18:38:42 +0000 |
commit | afc1b562fdca819b1c24b0efc094f256bd45267a (patch) | |
tree | ca76bcc8ae97bd607f74988c6d65a96836612752 /plugins/IEView/src/HTMLBuilder.cpp | |
parent | 6f03a0bf158226db5e50e099786a09ba4894a393 (diff) |
IEView: minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@16734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/HTMLBuilder.cpp')
-rw-r--r-- | plugins/IEView/src/HTMLBuilder.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 8a84367ff5..9001a14640 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -175,29 +175,24 @@ void HTMLBuilder::setLastEventTime(DWORD t) bool HTMLBuilder::isSameDate(time_t time1, time_t time2)
{
- struct tm tm_t1, tm_t2;
- tm_t1 = *localtime((time_t *)(&time1));
- tm_t2 = *localtime((time_t *)(&time2));
- if (tm_t1.tm_year == tm_t2.tm_year && tm_t1.tm_mon == tm_t2.tm_mon
- && tm_t1.tm_mday == tm_t2.tm_mday) {
- return true;
- }
- return false;
+ tm *tm_t1 = localtime(&time1), *tm_t2 = localtime(&time2);
+ return tm_t1->tm_year == tm_t2->tm_year && tm_t1->tm_mon == tm_t2->tm_mon && tm_t1->tm_mday == tm_t2->tm_mday;
+
}
void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut)
{
- CONTACTINFO ci;
- char buf[128];
- char *szProto;
+ CONTACTINFO ci = { 0 };
+ char buf[128] = { 0 };
+ const char *szProto = GetContactProto(hContact);
+
hContact = getRealContact(hContact);
- szProto = getProto(hContact);
- memset(&ci, 0, sizeof(ci));
+
ci.cbSize = sizeof(ci);
ci.hContact = hContact;
- ci.szProto = szProto;
+ ci.szProto = const_cast<char*>(szProto);
ci.dwFlag = CNF_UNIQUEID;
- buf[0] = 0;
+
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
switch (ci.type) {
case CNFT_ASCIIZ:
@@ -211,6 +206,7 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut) }
uinIn = mir_utf8encode(buf);
ci.hContact = NULL;
+
buf[0] = 0;
if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
switch (ci.type) {
@@ -224,7 +220,6 @@ void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut) }
}
uinOut = mir_utf8encode(buf);
- mir_free(szProto);
}
wchar_t *HTMLBuilder::getContactName(MCONTACT hContact, const char *szProto)
|