Topic class

Implementers

Constructors

Topic(String topicName)

Properties

acs ↔ AccessMode
This topic's access mode
getter/setter pair
clear int?
in case some messages were deleted, the greatest ID of a deleted message, optional
getter/setter pair
created DateTime?
Timestamp when the topic was created
getter/setter pair
defacs DefAcs?
topic's default access permissions; present only if the current user has 'S' permission
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isSubscribed bool
getter/setter pair
lastDescUpdate DateTime
no setter
lastSubsUpdate DateTime?
no setter
maxDel int
no setter
maxSeq int
no setter
messages List<DataMessage>
Get all cached subscriptions for this topic
no setter
minSeq int
no setter
name String?
This topic's name
getter/setter pair
onAllMessagesReceived ↔ PublishSubject<int>
This event will be triggered when all messages are received
getter/setter pair
onData ↔ PublishSubject<DataMessage?>
This event will be triggered when a data message is received
getter/setter pair
onInfo ↔ PublishSubject<InfoMessage>
This event will be triggered when a meta.info message is received
getter/setter pair
onMeta ↔ PublishSubject<MetaMessage>
This event will be triggered when a meta message is received
getter/setter pair
onMetaDesc ↔ PublishSubject<Topic>
This event will be triggered when a meta.desc message is received
getter/setter pair
onMetaSub ↔ PublishSubject<TopicSubscription>
This event will be triggered when a meta.sub message is received
getter/setter pair
onPres ↔ PublishSubject<PresMessage>
This event will be triggered when a pres message is received
getter/setter pair
onSubsUpdated ↔ PublishSubject<List<TopicSubscription>>
This event will be triggered when topic subscriptions are updated
getter/setter pair
onTagsUpdated ↔ PublishSubject<List<String>>
This event will be triggered when topic tags are updated
getter/setter pair
private ↔ dynamic
Application-defined data that's available to the current user only
getter/setter pair
public ↔ dynamic
Application-defined data that's available to all topic subscribers
getter/setter pair
read int?
Id of the message user claims through {note} message to have read, optional
getter/setter pair
recv int?
Like 'read', but received, optional
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seq int?
getter/setter pair
status String?
account status; included for me topic only, and only if the request is sent by a root-authenticated session.
getter/setter pair
subscribers Map<String, TopicSubscription>
Get all cached subscriptions for this topic
no setter
tags List<String>
User discovery tags
getter/setter pair
touched DateTime?
Timestamp of the last messages
getter/setter pair
updated DateTime
Timestamp when the topic was last updated
getter/setter pair

Methods

allMessagesReceived(int count) → void
This should be called by Tinode when all messages are received
archive(bool archive) Future
Archive or un-archive the topic. Wrapper for Tinode.setMeta
createMessage(dynamic data, bool echo) → Message
Create a draft of a message without sending it to the server
deleteMessages(List<DelRange> ranges, bool hard) Future<CtrlMessage>
Delete messages. Hard-deleting messages requires Owner permission
deleteMessagesAll(bool hard) Future<CtrlMessage>
Delete all messages. Hard-deleting messages requires Owner permission
deleteMessagesList(List<int> list, bool hard) Future<CtrlMessage>
Delete multiple messages defined by their IDs. Hard-deleting messages requires Owner permission
deleteSubscription(String userId) Future<CtrlMessage>
Delete subscription. Requires Share permission. Wrapper for Tinode.deleteSubscription
deleteTopic(bool hard) Future<CtrlMessage>
Delete topic. Requires Owner permission. Wrapper for Tinode.delTopic
flushMessage(int seqId) DataMessage?
flushMessageRange(int fromId, int untilId) → void
getAccessMode() → AccessMode
Get topic's access node
getDefaultAccess() DefAcs?
Get topic's default access mode
getMessagesPage(int limit, bool forward) Future
Request more messages from the server
getMeta(GetQuery params) Future
Request topic metadata from the serve
getTags() List<String>
Get topic's tags
getType() String?
Get type of the topic: me, p2p, grp, fnd...
invite(String userId, String mode) Future<CtrlMessage>
Create new topic subscription. Wrapper for Tinode.setMeta
isArchived() bool
Check if topic is archived, i.e. private.arch == true.
isChannel() bool
Check if topic is a channel
isGroup() bool
Check if topic is a group topic
isNewMessage(dynamic seqId) bool
Check if the given seq Id is id of the most recent message seqId id of the message to check
isP2P() bool
Check if topic is a p2p topic
leave(bool unsubscribe) Future<CtrlMessage>
Leave the topic, optionally unsubscribe. Leaving the topic means the topic will stop receiving updates from the server. Unsubscribing will terminate user's relationship with the topic.
msgHasMoreMessages(bool newer) bool
Check if cached message IDs indicate that the server may have more messages. newer check for newer messages
msgReadCount(int seq) int
Get the number of topic subscribers who marked this message (and all older messages) as read. The current user is excluded from the count
msgRecvCount(int seq) int
Get the number of topic subscribers who marked this message (and all older messages) as read The current user is excluded from the count
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
noteKeyPress() → void
Send a key-press notification. Wrapper for Tinode.noteKeyPress
noteRead(int? seq) → void
Send a 'read' receipt. Wrapper for Tinode.noteRead
noteReceive(int seq) → void
Send a 'recv' receipt. Wrapper for Tinode.noteRecv
p2pPeerDesc() TopicSubscription?
Get description of the p2p peer from subscription cache
processDelMessages(int clear, List<DeleteTransactionRange> delseq) → void
Delete cached messages and update cached transaction IDs
processMetaCreds(List<Credential> cred, bool a) → void
processMetaDesc(TopicDescription desc) → void
Called by Tinode when meta.desc packet is received.
processMetaSub(List<TopicSubscription> subscriptions) → void
Called by Tinode when meta.sub is received or in response to received
processMetaTags(List<String> tags) → void
Called by Tinode when meta.tags is received.
publishMessage(Message message) Future<CtrlMessage>
Publish message created by Topic.createMessage.
resetSubscription() → void
Reset subscribed state
routeData(DataMessage data) → void
Process data message
routeInfo(InfoMessage info) → void
routeMeta(MetaMessage meta) → void
Called by Tinode
routePres(PresMessage pres) → void
Process presence change message
setMeta(SetParams params) Future<CtrlMessage>
Update topic metadata
startMetaQuery() MetaGetBuilder
Initialize new meta {@link Tinode.GetQuery} builder. The query is attached to the current topic. It will not work correctly if used with a different topic
subscribe(GetQuery getParams, SetParams? setParams) Future<CtrlMessage>
subscriber(String userId) TopicSubscription?
Get cached subscription for the given user Id
toString() String
A string representation of this object.
inherited
updateMode(String? userId, String update) Future<CtrlMessage>
Update access mode of the current user or of another topic subscriber
userDescription(String userId) TopicSubscription?
Get user description from global cache. The user does not need to be a subscriber of this topic.

Operators

operator ==(Object other) bool
The equality operator.
inherited