diff options
author | George Hazan <ghazan@miranda.im> | 2022-02-08 19:22:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-02-08 19:22:02 +0300 |
commit | 760867149a99443036f53c73190d53bd87039def (patch) | |
tree | 1711908197fb43057a11ba71fbd0019553b65c52 /plugins | |
parent | 5aebbf6c518190ea03ef3e26ef3f0cd74ff928ce (diff) |
fixes #3023 (IEView: не отображаются подписи к файлтрансферам)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ExternalAPI/m_ieview.h | 2 | ||||
-rw-r--r-- | plugins/IEView/src/HTMLBuilder.cpp | 12 | ||||
-rw-r--r-- | plugins/IEView/src/Template.cpp | 2 | ||||
-rw-r--r-- | plugins/IEView/src/Template.h | 1 | ||||
-rw-r--r-- | plugins/IEView/src/TemplateHTMLBuilder.cpp | 11 | ||||
-rw-r--r-- | plugins/IEView/src/ieview_logger.cpp | 2 | ||||
-rw-r--r-- | plugins/IEView/src/version.h | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/msglog.cpp | 23 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.h | 1 |
9 files changed, 19 insertions, 37 deletions
diff --git a/plugins/ExternalAPI/m_ieview.h b/plugins/ExternalAPI/m_ieview.h index d02d3cdccc..cd2c107f55 100644 --- a/plugins/ExternalAPI/m_ieview.h +++ b/plugins/ExternalAPI/m_ieview.h @@ -55,7 +55,6 @@ struct IEVIEWWINDOW #define IEEDF_UNICODE 0x00000001 // if set pszText is a pointer to wchar_t string instead of char string
#define IEEDF_UNICODE_TEXT 0x00000001 // if set pszText is a pointer to wchar_t string instead of char string
#define IEEDF_UNICODE_NICK 0x00000002 // if set pszNick is a pointer to wchar_t string instead of char string
-#define IEEDF_UNICODE_TEXT2 0x00000004 // if set pszText2 is a pointer to wchar_t string instead of char string
/* The following flags are valid only for message events (IEED_EVENT_MESSAGE) */
#define IEEDF_FORMAT_FONT 0x00000100 // if set pszFont (font name) is valid and should be used
@@ -125,7 +124,6 @@ struct IEVIEWEVENTDATA BOOL bIsMe; // TRUE if the event is related to the user
DWORD time; // Time of the event
IEVIEWEVENTDATA *next;
- MAllCStrings szText2;
};
/* IEView events */
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index bc46529b1d..3398d2b003 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -216,13 +216,13 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) }
IEVIEWEVENTDATA *eventData = new IEVIEWEVENTDATA;
- eventData->dwFlags = IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK | IEEDF_UNICODE_TEXT2 |
+ eventData->dwFlags = IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK |
(dbei.flags & DBEF_READ ? IEEDF_READ : 0) | (dbei.flags & DBEF_SENT ? IEEDF_SENT : 0) | (dbei.flags & DBEF_RTL ? IEEDF_RTL : 0);
if (event->dwFlags & IEEF_RTL)
eventData->dwFlags |= IEEDF_RTL;
eventData->time = dbei.timestamp;
- eventData->szNick.a = eventData->szText.a = eventData->szText2.a = nullptr;
+ eventData->szNick.a = eventData->szText.a = nullptr;
if (dbei.flags & DBEF_SENT) {
eventData->szNick.w = getContactName(NULL, szProto);
eventData->bIsMe = TRUE;
@@ -243,8 +243,11 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) char* filename = ((char *)dbei.pBlob) + sizeof(uint32_t);
char* descr = filename + mir_strlen(filename) + 1;
eventData->szText.w = DbEvent_GetString(&dbei, filename);
- if (*descr != '\0')
- eventData->szText2.w = DbEvent_GetString(&dbei, descr);
+ if (*descr != '\0') {
+ CMStringW tmp(FORMAT, L"%s (%s)", eventData->szText.w, ptrW(DbEvent_GetString(&dbei, descr)).get());
+ mir_free((void*)eventData->szText.w);
+ eventData->szText.w = tmp.Detach();
+ }
eventData->iType = IEED_EVENT_FILE;
}
else if (dbei.eventType == EVENTTYPE_AUTHREQUEST) {
@@ -279,7 +282,6 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) for (IEVIEWEVENTDATA* eventData2 = newEvent.eventData; eventData2 != nullptr;) {
IEVIEWEVENTDATA *eventData = eventData2->next;
mir_free((void*)eventData2->szText.w);
- mir_free((void*)eventData2->szText2.w);
mir_free((void*)eventData2->szNick.w);
delete eventData2;
eventData2 = eventData;
diff --git a/plugins/IEView/src/Template.cpp b/plugins/IEView/src/Template.cpp index c171a141c1..5571182887 100644 --- a/plugins/IEView/src/Template.cpp +++ b/plugins/IEView/src/Template.cpp @@ -123,7 +123,6 @@ static TokenDef tokenNames[] = { TokenDef("%nickIn%", Token::NICKIN, 0),
TokenDef("%nickOut%", Token::NICKOUT, 1),
TokenDef("%statusMsg%", Token::STATUSMSG, 0),
- TokenDef("%fileDesc%", Token::FILEDESC, 0),
TokenDef("%\\name%", Token::INAME, 1),
TokenDef("%\\time%", Token::TIME, 1),
@@ -143,7 +142,6 @@ static TokenDef tokenNames[] = { TokenDef("%\\nickIn%", Token::NICKIN, 1),
TokenDef("%\\nickOut%", Token::NICKOUT, 1),
TokenDef("%\\statusMsg%", Token::STATUSMSG, 1),
- TokenDef("%\\fileDesc%", Token::FILEDESC, 1)
};
void Template::tokenize()
diff --git a/plugins/IEView/src/Template.h b/plugins/IEView/src/Template.h index a42c4c92af..64ac8ab561 100644 --- a/plugins/IEView/src/Template.h +++ b/plugins/IEView/src/Template.h @@ -60,7 +60,6 @@ public: STATUSMSG,
NICKIN,
NICKOUT,
- FILEDESC,
};
Token(int, const char *, int);
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index a93f761fda..b9688859b6 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -385,7 +385,7 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, tmpltName[1] = nullptr;
groupTemplate = nullptr;
- char *szName = nullptr, *szText = nullptr, *szFileDesc = nullptr;
+ char *szName = nullptr, *szText = nullptr;
if (event->eventData->dwFlags & IEEDF_UNICODE_NICK)
szName = encodeUTF8(event->hContact, eventData->szNick.w, ENF_NAMESMILEYS, true);
else
@@ -396,11 +396,6 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, else
szText = encodeUTF8(event->hContact, eventData->szText.a, event->codepage, ENF_ALL, isSent);
- if (eventData->dwFlags & IEEDF_UNICODE_TEXT2)
- szFileDesc = encodeUTF8(event->hContact, eventData->szText2.w, 0, isSent);
- else
- szFileDesc = encodeUTF8(event->hContact, eventData->szText2.a, event->codepage, 0, isSent);
-
if (eventData->iType == IEED_EVENT_MESSAGE) {
if (!isRTL) {
if (isGrouping && (getFlags(protoSettings) & Options::LOG_GROUP_MESSAGES)) {
@@ -523,9 +518,6 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, case Token::NICKOUT:
tokenVal = szNickOut;
break;
- case Token::FILEDESC:
- tokenVal = szFileDesc;
- break;
}
if (tokenVal != nullptr) {
if (token->getEscape())
@@ -540,7 +532,6 @@ void TemplateHTMLBuilder::appendEventTemplate(IEView *view, IEVIEWEVENT *event, mir_free(szName);
mir_free(szText);
- mir_free(szFileDesc);
view->write(str);
}
diff --git a/plugins/IEView/src/ieview_logger.cpp b/plugins/IEView/src/ieview_logger.cpp index 13f781cd74..9da4150847 100644 --- a/plugins/IEView/src/ieview_logger.cpp +++ b/plugins/IEView/src/ieview_logger.cpp @@ -163,7 +163,7 @@ public: } ied.dwData |= IEEDD_GC_SHOW_TIME | IEEDD_GC_SHOW_ICON; - ied.dwFlags = IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK | IEEDF_UNICODE_TEXT2; + ied.dwFlags = IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK; HandleIEEvent(0, LPARAM(&event)); pLog = pLog->prev; diff --git a/plugins/IEView/src/version.h b/plugins/IEView/src/version.h index f21ae3bcf4..cb866319f0 100644 --- a/plugins/IEView/src/version.h +++ b/plugins/IEView/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 1 #define __MINOR_VERSION 6 #define __RELEASE_NUM 0 -#define __BUILD_NUM 4 +#define __BUILD_NUM 5 #include <stdver.h> diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 7149c1d410..cbb57583c1 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -97,7 +97,7 @@ EventData* CMsgDialog::GetEventFromDB(MCONTACT hContact, MEVENT hDbEvent) evt->eventType = dbei.eventType;
evt->dwFlags = (dbei.flags & DBEF_READ ? IEEDF_READ : 0) | (dbei.flags & DBEF_SENT ? IEEDF_SENT : 0) | (dbei.flags & DBEF_RTL ? IEEDF_RTL : 0);
- evt->dwFlags |= IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK | IEEDF_UNICODE_TEXT2;
+ evt->dwFlags |= IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK;
if (m_bUseRtl)
evt->dwFlags |= IEEDF_RTL;
@@ -113,8 +113,11 @@ EventData* CMsgDialog::GetEventFromDB(MCONTACT hContact, MEVENT hDbEvent) char *filename = ((char*)dbei.pBlob) + sizeof(uint32_t);
char *descr = filename + mir_strlen(filename) + 1;
evt->szText.w = DbEvent_GetString(&dbei, filename);
- if (*descr != 0)
- evt->szText2.w = DbEvent_GetString(&dbei, descr);
+ if (*descr != 0) {
+ ptrW wszDescr(DbEvent_GetString(&dbei, descr));
+ CMStringW tmp(FORMAT, L"%s (%s)", evt->szText.w, wszDescr.get());
+ replaceStrW(evt->szText.w, tmp.Detach());
+ }
}
else evt->szText.w = DbEvent_GetTextW(&dbei, CP_UTF8);
@@ -129,7 +132,7 @@ static EventData* GetTestEvent(uint32_t flags) EventData *evt = (EventData *)mir_calloc(sizeof(EventData));
evt->eventType = EVENTTYPE_MESSAGE;
evt->dwFlags = IEEDF_READ | flags;
- evt->dwFlags |= IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK | IEEDF_UNICODE_TEXT2;
+ evt->dwFlags |= IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK;
evt->time = time(0);
return evt;
}
@@ -165,7 +168,6 @@ static void freeEvent(EventData *evt) {
mir_free(evt->szNick.w);
mir_free(evt->szText.w);
- mir_free(evt->szText2.w);
mir_free(evt);
}
@@ -516,16 +518,8 @@ char* CMsgDialog::CreateRTFFromEvent(EventData *evt, GlobalMessageData *gdat, Lo else
AppendAnsiToBuffer(buf, evt->szText.a);
}
-
- if (evt->szText2.w != nullptr) {
- AppendUnicodeToBuffer(buf, L" (");
- if (evt->dwFlags & IEEDF_UNICODE_TEXT2)
- AppendUnicodeToBuffer(buf, evt->szText2.w);
- else
- AppendAnsiToBuffer(buf, evt->szText2.a);
- AppendUnicodeToBuffer(buf, L")");
- }
break;
+
default:
if (gdat->flags.bMsgOnNewline && showColon)
buf.Append("\\line");
@@ -534,6 +528,7 @@ char* CMsgDialog::CreateRTFFromEvent(EventData *evt, GlobalMessageData *gdat, Lo AppendWithCustomLinks(evt, style, buf);
break;
}
+
if (m_isMixed)
buf.Append("\\par");
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index aa33a9031d..7a24047769 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -62,7 +62,6 @@ struct EventData COLORREF color;
MAllStrings szNick; // Nick, usage depends on type of event
MAllStrings szText; // Text, usage depends on type of event
- MAllStrings szText2; // Text, usage depends on type of event
uint32_t time;
uint32_t eventType;
BOOL custom;
|