ObbyClient class
One connection.
Call close when finished. The engine holds native memory that Dart's collector knows nothing about, so nothing releases it on your behalf.
One client belongs to one isolate. The native handle is not synchronised, so sending its address to another isolate and rebuilding it there is undefined behaviour, not merely a race. Give each isolate its own client.
Constructors
-
ObbyClient(Map<
String, dynamic> config, {String? libraryPath}) -
Open a connection's engine.
factory
Properties
Methods
-
addReaction(
String target, String msgid, String emoji) → bool - React to a message with an emoji.
-
close(
) → void - Release the engine. Safe to call more than once.
-
command(
Map< String, dynamic> command) → bool - Do something on this connection. Returns false when the command could not be read.
-
fetchHistory(
String target, {String? before, int limit = 50}) → bool - Ask for older messages than the ones we hold.
-
handleBytes(
Uint8List data) → void - Feed whatever the transport read. Partial lines are held until the rest arrives.
-
handleConnected(
) → void - Tell the engine the transport is up. Queues the registration burst.
-
handleDisconnected(
) → void - Tell the engine its transport died. The model survives, so a reconnect resumes from it.
-
join(
String channel, {String? key}) → bool - Join a channel.
-
markRead(
String target, String timestamp) → bool - Tell the server how far we have read.
-
model(
) → Map< String, dynamic> - Everything the connection knows: channels, members, conversations, messages.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
part(
String channel, {String? reason}) → bool - Leave a channel.
-
pollEvents(
) → List< Map< String, dynamic> > - Every event queued since the last call.
-
pollTimeout(
) → int? - When tick next has something to do, or null when nothing is scheduled.
-
pollTransmit(
) → Uint8List? - Bytes to write to the transport, or null when there are none.
-
quit(
{String? reason}) → bool - Leave the network.
-
redactMessage(
String target, String msgid, {String? reason}) → bool - Ask the server to delete a message.
-
removeReaction(
String target, String msgid, String emoji) → bool - Take a reaction back.
-
sendAction(
String target, String text) → bool -
Send a
CTCP ACTION, the third-person form. -
sendMessage(
String target, String text) → bool - Say something to a channel or a person.
-
sendNotice(
String target, String text) → bool - Send a notice, which by convention must never be auto-replied to.
-
sendRawLine(
String line) → bool - Send a line the engine does not model. The escape hatch, so you are never stuck waiting on it.
-
sendVoiceSignal(
String channel, String signalJson) → bool - Send a voice signalling frame to a room.
-
setAway(
{String? message}) → bool - Mark ourselves away, or come back.
-
setMetadata(
String key, {String? value}) → bool - Set one of our own metadata keys, or clear it.
-
setNick(
String nick) → bool - Change our nick.
-
setTopic(
String channel, {String? topic}) → bool - Set or clear a channel topic.
-
setTyping(
String target, TypingState state) → bool - Say we are typing, so others can show it.
-
subscribeMetadata(
List< String> keys) → bool - Ask to be told when these metadata keys change on anyone we can see.
-
tick(
int monotonicMs, int unixMs) → void -
Advance the clock.
monotonicMsdrives every deadline;unixMsonly stamps a message the server did not stamp itself. -
toString(
) → String -
A string representation of this object.
inherited
-
unwatchNicks(
List< String> nicks) → bool - Stop watching these nicks.
-
watchNicks(
List< String> nicks) → bool - Watch these nicks, so the server says when they come and go.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited