Skip to content

Commit

Permalink
🐜 Small bug (#30)
Browse files Browse the repository at this point in the history
Unit: Notify.API.Indy

- The routine used to fire the messages array when polling option was
used wasn't working correctly. A small adjustment was made to split the
server response string into a string array and then fire a new message
for each array item.
  • Loading branch information
p-samuel committed Jan 10, 2023
2 parents 10509a9 + 345f6ab commit 673a410
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Notify.Api.Indy.pas
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ implementation
IdURI,
Notify.SmartPointer,
System.SysUtils,
System.StrUtils,
System.Types,
Notify.Logs,
Notify.Notification.DTO, Notify.Error, Notify.Response.Data;
Notify.Notification.DTO,
Notify.Error,
Notify.Response.Data;

{ TNotityApiIndy }

Expand Down Expand Up @@ -333,6 +337,8 @@ destructor TSSEThread.Destroy;
procedure TSSEThread.DoOnWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount: Int64);
var
LEventString: UTF8String;
LStrings: TArray<String>;
LString: UTF8String;
begin

if Terminated then
Expand All @@ -347,7 +353,10 @@ procedure TSSEThread.DoOnWork(ASender: TObject; AWorkMode: TWorkMode; AWorkCount
if LEventString = FCloseConnectionMessage then
FIdHttp.Socket.Close;

NxHorizon.Instance.Post<TNotifySubscriptionEvent>(LEventString);
LStrings := SplitString(LEventString, #$A);

for LString in LStrings do
NxHorizon.Instance.Post<TNotifySubscriptionEvent>(LString);

end;

Expand Down

0 comments on commit 673a410

Please sign in to comment.