From 8c18d1fe6f83807116c065e548ee6b567f4b49a1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 Jan 2019 22:50:52 +0300 Subject: fixes #1776 (any traces of URL* related constants removed) --- plugins/HistoryPlusPlus/CustomizeFiltersForm.pas | 2 +- plugins/HistoryPlusPlus/HistoryForm.pas | 8 --- plugins/HistoryPlusPlus/hpp_eventfilters.pas | 3 +- plugins/HistoryPlusPlus/hpp_events.pas | 70 +----------------------- plugins/HistoryPlusPlus/hpp_externalgrid.pas | 10 +--- plugins/HistoryPlusPlus/hpp_global.pas | 2 +- plugins/HistoryPlusPlus/hpp_options.pas | 4 +- plugins/HistoryPlusPlus/hpp_sessionsthread.pas | 3 +- 8 files changed, 8 insertions(+), 94 deletions(-) (limited to 'plugins/HistoryPlusPlus') diff --git a/plugins/HistoryPlusPlus/CustomizeFiltersForm.pas b/plugins/HistoryPlusPlus/CustomizeFiltersForm.pas index fdfda0597a..393356a81d 100644 --- a/plugins/HistoryPlusPlus/CustomizeFiltersForm.pas +++ b/plugins/HistoryPlusPlus/CustomizeFiltersForm.pas @@ -138,7 +138,7 @@ begin SetLength(LocalFilters,i+1); LocalFilters[i].Name := NewName; LocalFilters[i].filMode := FM_INCLUDE; - LocalFilters[i].filEvents := [mtIncoming,mtOutgoing,mtMessage,mtUrl,mtFile]; + LocalFilters[i].filEvents := [mtIncoming,mtOutgoing,mtMessage,mtFile]; LocalFilters[i].Events := GenerateEvents(LocalFilters[i].filMode,LocalFilters[i].filEvents); lbFilters.Items.Add(NewName); diff --git a/plugins/HistoryPlusPlus/HistoryForm.pas b/plugins/HistoryPlusPlus/HistoryForm.pas index e6a2fa7429..6a737a7b3e 100644 --- a/plugins/HistoryPlusPlus/HistoryForm.pas +++ b/plugins/HistoryPlusPlus/HistoryForm.pas @@ -2279,14 +2279,6 @@ begin else Item.FileName := UTF8Encode(MakeTextXMLedA(tmp)); end - else if mtUrl in hg.Items[Index].MessageType then - begin - tmp := hg.Items[Index].Extended; - if tmp = '' then - Item.Url := '&UNK;' - else - Item.Url := UTF8Encode(MakeTextXMLedA(tmp)); - end else if mtAvatarChange in hg.Items[Index].MessageType then begin tmp := hg.Items[Index].Extended; diff --git a/plugins/HistoryPlusPlus/hpp_eventfilters.pas b/plugins/HistoryPlusPlus/hpp_eventfilters.pas index 1c58e7da1e..2353701217 100644 --- a/plugins/HistoryPlusPlus/hpp_eventfilters.pas +++ b/plugins/HistoryPlusPlus/hpp_eventfilters.pas @@ -77,10 +77,9 @@ var filterAll: TMessageTypes; const - hppIntDefEventFilters: array[0..12] of ThppEventFilter = ( + hppIntDefEventFilters: array[0..11] of ThppEventFilter = ( (Name: 'Show all events'; Events: []; filMode: FM_EXCLUDE; filEvents: []), (Name: 'Messages'; Events: []; filMode: FM_INCLUDE; filEvents: [mtMessage,mtIncoming,mtOutgoing]), - (Name: 'Link URLs'; Events: []; filMode: FM_INCLUDE; filEvents: [mtUrl,mtIncoming,mtOutgoing]), (Name: 'Files'; Events: []; filMode: FM_INCLUDE; filEvents: [mtFile,mtIncoming,mtOutgoing]), (Name: 'Contacts'; Events: []; filMode: FM_INCLUDE; filEvents: [mtContacts,mtIncoming,mtOutgoing]), (Name: 'Status changes'; Events: []; filMode: FM_INCLUDE; filEvents: [mtStatus,mtIncoming,mtOutgoing]), diff --git a/plugins/HistoryPlusPlus/hpp_events.pas b/plugins/HistoryPlusPlus/hpp_events.pas index 84e21102f4..4ade13228a 100644 --- a/plugins/HistoryPlusPlus/hpp_events.pas +++ b/plugins/HistoryPlusPlus/hpp_events.pas @@ -72,7 +72,6 @@ const (Name:'Incoming events'; XML:''; i:HPP_ICON_EVENT_INCOMING; iName:'hppevn_inc'; iSkin:-1), (Name:'Outgoing events'; XML:''; i:HPP_ICON_EVENT_OUTGOING; iName:'hppevn_out'; iSkin:-1), (Name:'Message'; XML:'MSG'; i:HPP_SKIN_EVENT_MESSAGE; iSkin:SKINICON_EVENT_MESSAGE), - (Name:'Link'; XML:'URL'; i:HPP_SKIN_EVENT_URL; iSkin:SKINICON_EVENT_URL), (Name:'File transfer'; XML:'FILE'; i:HPP_SKIN_EVENT_FILE; iSkin:SKINICON_EVENT_FILE), (Name:'System message'; XML:'SYS'; i:HPP_ICON_EVENT_SYSTEM; iName:'hppevn_sys'; iSkin:-1), (Name:'Contacts'; XML:'ICQCNT'; i:HPP_ICON_EVENT_CONTACTS; iName:'hppevn_icqcnt'; iSkin:-1), @@ -115,7 +114,6 @@ function GetEventCoreText(EventInfo: TDBEventInfo; var Hi: THistoryItem): Boolea // specific routines procedure GetEventTextForMessage(EventInfo: TDBEventInfo; var Hi: THistoryItem); procedure GetEventTextForFile(EventInfo: TDBEventInfo; var Hi: THistoryItem); -procedure GetEventTextForUrl(EventInfo: TDBEventInfo; var Hi: THistoryItem); procedure GetEventTextForAuthRequest(EventInfo: TDBEventInfo; var Hi: THistoryItem); procedure GetEventTextForYouWereAdded(EventInfo: TDBEventInfo; var Hi: THistoryItem); procedure GetEventTextForSms(EventInfo: TDBEventInfo; var Hi: THistoryItem); @@ -185,13 +183,12 @@ type end; var - EventTable: array[0..28] of TEventTableItem = ( + EventTable: array[0..27] of TEventTableItem = ( // must be the first item in array for unknown events (EventType: MaxWord; MessageType: mtOther; TextFunction: GetEventTextForOther), // events definitions (EventType: EVENTTYPE_MESSAGE; MessageType: mtMessage; TextFunction: GetEventTextForMessage), (EventType: EVENTTYPE_FILE; MessageType: mtFile; TextFunction: GetEventTextForFile), - (EventType: EVENTTYPE_URL; MessageType: mtUrl; TextFunction: GetEventTextForUrl), (EventType: EVENTTYPE_AUTHREQUEST; MessageType: mtSystem; TextFunction: GetEventTextForAuthRequest), (EventType: EVENTTYPE_ADDED; MessageType: mtSystem; TextFunction: GetEventTextForYouWereAdded), (EventType: EVENTTYPE_CONTACTS; MessageType: mtContacts; TextFunction: GetEventTextForContacts), @@ -379,48 +376,6 @@ begin end; end; -function TextHasUrls(var Text: String): Boolean; -var - i,len,lenW: Integer; - pText,pPos: PChar; -begin - Result := False; - len := Length(Text); - if len=0 then exit; - - pText := PChar(Text); - for i := 0 to High(UrlPrefix) do - begin - pPos := StrPos(pText, PChar(UrlPrefix[i])); - if not Assigned(pPos) then - continue; - Result := ((uint_ptr(pPos) = uint_ptr(pText)) or not IsWideCharAlphaNumeric((pPos - 1)^)) and - IsWideCharAlphaNumeric((pPos + Length(UrlPrefix[i]))^); - if Result then - exit; - end; - - if not Assigned(StrPos(PChar(Text),':/')) then exit; - - lenW := (len+1)*SizeOf(Char); - - TextBuffer.Lock; - TextBuffer.Allocate(lenW); - Move(Text[1],TextBuffer.Buffer^,lenW); - CharLowerBuffW(PChar(TextBuffer.Buffer),len); - for i := 0 to High(UrlProto) do - begin - pPos := StrPos(PChar(TextBuffer.Buffer), PChar(UrlProto[i].proto)); - if not Assigned(pPos) then - continue; - Result := ((uint_ptr(pPos) = uint_ptr(TextBuffer.Buffer)) or - not IsWideCharAlphaNumeric((pPos - 1)^)); - if Result then - break; - end; - TextBuffer.Unlock; -end; - function GetEventInfo(hDBEvent: THANDLE): TDBEventInfo; var BlobSize: integer; @@ -488,12 +443,6 @@ begin EventTable[EventIndex].TextFunction(EventInfo, Result); Result.Text := AdjustLineBreaks(Result.Text); Result.Text := TrimRight(Result.Text); - if mtMessage in Result.MessageType then - if TextHasUrls(Result.Text) then - begin - exclude(Result.MessageType, mtMessage); - include(Result.MessageType, mtUrl); - end; finally EventBuffer.Unlock; end; @@ -579,23 +528,6 @@ begin end; end; -procedure GetEventTextForUrl(EventInfo: TDBEventInfo; var Hi: THistoryItem); -var - BytePos:LongWord; - Url,Desc: AnsiString; - cp: Cardinal; -begin - BytePos:=0; - ReadStringTillZeroA(Pointer(EventInfo.pBlob),EventInfo.cbBlob,Url,BytePos); - ReadStringTillZeroA(Pointer(EventInfo.pBlob),EventInfo.cbBlob,Desc,BytePos); - if Boolean(EventInfo.flags and DBEF_UTF) then - cp := CP_UTF8 - else - cp := Hi.CodePage; - hi.Text := Format(TranslateW('URL: %s'),[AnsiToWideString(url+#13#10+desc,cp)]); - hi.Extended := Url; -end; - procedure GetEventTextForFile(EventInfo: TDBEventInfo; var Hi: THistoryItem); var BytePos: LongWord; diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas index c97891746d..9bb7190c38 100644 --- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas +++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas @@ -534,7 +534,7 @@ begin // tabSRMM still doesn't marks events read in case of hpp log is in use... // if (FGridMode = gmIEView) and if (mtIncoming in Item.MessageType) and (MessageTypesToDWord(Item.MessageType) and - MessageTypesToDWord([mtMessage, mtUrl]) > 0) then + MessageTypesToDWord([mtMessage]) > 0) then begin if (not Item.IsRead) then db_event_markRead(Items[Index].hContact, Items[Index].hDBEvent); @@ -1197,14 +1197,6 @@ begin else Item.FileName := UTF8Encode(MakeTextXMLedA(tmp)); end - else if mtUrl in Grid.Items[Index].MessageType then - begin - tmp := Grid.Items[Index].Extended; - if tmp = '' then - Item.Url := '&UNK;' - else - Item.Url := UTF8Encode(MakeTextXMLedA(tmp)); - end else if mtAvatarChange in Grid.Items[Index].MessageType then begin tmp := Grid.Items[Index].Extended; diff --git a/plugins/HistoryPlusPlus/hpp_global.pas b/plugins/HistoryPlusPlus/hpp_global.pas index f9f198da2a..3d2c44f32b 100644 --- a/plugins/HistoryPlusPlus/hpp_global.pas +++ b/plugins/HistoryPlusPlus/hpp_global.pas @@ -63,7 +63,7 @@ type // be show as the last entry TMessageType = (mtUnknown, mtIncoming, mtOutgoing, - mtMessage, mtUrl, mtFile, mtSystem, + mtMessage, mtFile, mtSystem, mtContacts, mtSMS, mtWebPager, mtEmailExpress, mtStatus, mtSMTPSimple, mtOther, mtNickChange,mtAvatarChange,mtWATrack,mtStatusMessage,mtVoiceCall,mtCustom); diff --git a/plugins/HistoryPlusPlus/hpp_options.pas b/plugins/HistoryPlusPlus/hpp_options.pas index d8a442a711..cd072da153 100644 --- a/plugins/HistoryPlusPlus/hpp_options.pas +++ b/plugins/HistoryPlusPlus/hpp_options.pas @@ -157,10 +157,10 @@ const Mes: [mtFile,mtOutgoing]; style:0; size: -11; color: $000000; back: $9BEEE3), (_type: [hppFont,hppColor]; name: 'Incoming url'; - Mes: [mtUrl,mtIncoming]; style:0; size: -11; color: $000000; back: $F4D9CC), + Mes: [mtIncoming]; style:0; size: -11; color: $000000; back: $F4D9CC), (_type: [hppFont,hppColor]; name: 'Outgoing url'; - Mes: [mtUrl,mtOutgoing]; style:0; size: -11; color: $000000; back: $F4D9CC), + Mes: [mtOutgoing]; style:0; size: -11; color: $000000; back: $F4D9CC), (_type: [hppFont,hppColor]; name: 'Incoming SMS Message'; Mes: [mtSMS,mtIncoming]; style:0; size: -11; color: $000000; back: $CFF4FE), diff --git a/plugins/HistoryPlusPlus/hpp_sessionsthread.pas b/plugins/HistoryPlusPlus/hpp_sessionsthread.pas index b9a9109bf1..5a57ca9cb4 100644 --- a/plugins/HistoryPlusPlus/hpp_sessionsthread.pas +++ b/plugins/HistoryPlusPlus/hpp_sessionsthread.pas @@ -116,10 +116,9 @@ function IsEventInSession(EventType: Word): boolean; implementation const - SessionEvents: array[0..3] of Word = ( + SessionEvents: array[0..2] of Word = ( EVENTTYPE_MESSAGE, EVENTTYPE_FILE, - EVENTTYPE_URL, EVENTTYPE_CONTACTS); function IsEventInSession(EventType: Word): boolean; -- cgit v1.2.3