TsgcWSPClient_E2EEMethods › SendGroupMessage

SendGroupMessage Method

Sends an encrypted message (text, stream or bytes) to all online members of a group.

Overloads

Overload 1

Syntax

function SendGroupMessage(const aGroup, aText: string): string;

Parameters

NameTypeDescription
aGroupconst stringName of the destination group. The local user must already be a member.
aTextconst stringPlain text payload. Content is encrypted before being sent.

Return Value

Message identifier used to correlate the send with OnE2EEGroupMessageAck. Empty when the message could not be queued (string).

Remarks

Encrypts aText with the group key and asks the server to relay the encrypted payload to every online member of aGroup. Each recipient receives the decrypted text through OnE2EEGroupMessageText. When acknowledgments are enabled, the sender receives OnE2EEGroupMessageAck per recipient.

Example

oE2EE.SendGroupMessage('TEAM01', 'Build finished');

Overload 2

Syntax

function SendGroupMessage(const aGroup: string; const aStream: TStream): string;

Parameters

NameTypeDescription
aGroupconst stringName of the destination group. The local user must already be a member.
aStreamconst TStreamStream containing the binary payload. The entire stream content is read and encrypted.

Return Value

Message identifier used to correlate the send with OnE2EEGroupMessageAck. Empty when the message could not be queued (string).

Remarks

Same as the text overload, but the payload is taken from a TStream and delivered to members as binary data through OnE2EEGroupMessageBinary. Suitable for files or arbitrary binary buffers.

Example

oStream := TFileStream.Create('report.pdf', fmOpenRead);
try
  oE2EE.SendGroupMessage('TEAM01', oStream);
finally
  oStream.Free;
end;

Back to Methods