summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-09 17:04:49 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-09 17:04:49 +0300
commit125374d005e0e5e05c2d0a22c003ef4cb56a2624 (patch)
tree1c643586fdc9b12629ab70982014c05a269c9ae0
parent44323255f6e922e5e2ade2d0c59ca0fe2f532967 (diff)
h++ not to dig the blob directly
-rw-r--r--plugins/HistoryPlusPlus/hpp_events.pas14
1 files changed, 6 insertions, 8 deletions
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);