TsgcWSPServer_PresenceEvents › OnBeforeNewChannel

OnBeforeNewChannel Event

Fired before a new channel is created; set Accept to False to reject it.

Syntax

property OnBeforeNewChannel: TsgcWSPresenceBeforeNewChannel;
// TsgcWSPresenceBeforeNewChannel = procedure(Connection: TsgcWSConnection; const aChannel: TsgcWSPresenceChannel; const aMember: TsgcWSPresenceMember; var Accept: Boolean) of object

Default Value

Remarks

Called when a member requests to subscribe to a channel that does not yet exist. The server can accept or reject the creation of the channel by setting Accept. By default all channels are accepted.

Example

procedure TForm1.sgcWSPServer_Presence1BeforeNewChannel(Connection: TsgcWSConnection;
  const aChannel: TsgcWSPresenceChannel; const aMember: TsgcWSPresenceMember;
  var Accept: Boolean);
begin
  if aChannel.Name = 'Spam' then
    Accept := False;
end;

Back to Events