From 125374d005e0e5e05c2d0a22c003ef4cb56a2624 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 9 Apr 2023 17:04:49 +0300 Subject: h++ not to dig the blob directly --- plugins/HistoryPlusPlus/hpp_events.pas | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/HistoryPlusPlus/hpp_events.pas b/plugins/HistoryPlusPlus/hpp_events.pas index 561e8848a9..2996009325 100644 --- a/plugins/HistoryPlusPlus/hpp_events.pas +++ b/plugins/HistoryPlusPlus/hpp_events.pas @@ -562,14 +562,9 @@ end; procedure GetEventTextForFile(EventInfo: TDBEventInfo; var Hi: THistoryItem); var - BytePos: LongWord; - FileName,Desc: AnsiString; + PText: PWideChar; cp: Cardinal; begin - //blob is: sequenceid(DWORD),filename(ASCIIZ),description(ASCIIZ) - BytePos := 4; - ReadStringTillZeroA(Pointer(EventInfo.pBlob), EventInfo.cbBlob, FileName, BytePos); - ReadStringTillZeroA(Pointer(EventInfo.pBlob), EventInfo.cbBlob, Desc, BytePos); if Boolean(EventInfo.flags and DBEF_SENT) then Hi.Text := 'Outgoing file transfer: %s' else @@ -578,8 +573,11 @@ begin cp := CP_UTF8 else cp := Hi.CodePage; - Hi.Text := Format(TranslateUnicodeString(Hi.Text), [AnsiToWideString(FileName + #13#10 + Desc, cp)]); - Hi.Extended := FileName; + PText := DbEvent_GetTextW(@EventInfo, CP_ACP); + if not Assigned(PText) then + PText := mir_wstrdup(''); + Hi.Text := Format(TranslateUnicodeString(Hi.Text), [PText]); + Hi.Extended := ''; end; procedure GetEventTextForAuthRequest(EventInfo: TDBEventInfo; var Hi: THistoryItem); -- cgit v1.2.3