-
public final class ThreadKt
-
-
Method Summary
Modifier and Type Method Description final static List<ThreadParticipant>sortedByLastReply(List<ThreadParticipant> $self)Sorts participants by ThreadParticipant.lastThreadMessageAt descending (most recent repliers first). final static ThreadupdateParentOrReply(Thread $self, Message message)Updates the given Thread with the new message (parent or reply). final static ThreadupdateParent(Thread $self, Message parent)Updates the parent message of a Thread. final static ThreadupsertReply(Thread $self, Message reply)Inserts a new reply (or updates and existing one) in a Thread. final static ThreadmarkAsReadByUser(Thread $self, ThreadInfo threadInfo, User user, Date createdAt)Marks the given thread as read by the given user. final static ThreadapplyThreadUpdatedEventChanges(Thread $self, ThreadInfo threadInfo)Applies the updated thread info from a thread.updatedevent to this Thread.final static ThreadmarkAsUnreadByUser(Thread $self, User user, Date createdAt)Marks the given thread as unread by the given user. -
-
Method Detail
-
sortedByLastReply
final static List<ThreadParticipant> sortedByLastReply(List<ThreadParticipant> $self)
Sorts participants by ThreadParticipant.lastThreadMessageAt descending (most recent repliers first). Participants with null ThreadParticipant.lastThreadMessageAt (e.g. mentioned-only, never replied) are placed last.
-
updateParentOrReply
final static Thread updateParentOrReply(Thread $self, Message message)
Updates the given Thread with the new message (parent or reply).
-
updateParent
final static Thread updateParent(Thread $self, Message parent)
Updates the parent message of a Thread.
-
upsertReply
final static Thread upsertReply(Thread $self, Message reply)
Inserts a new reply (or updates and existing one) in a Thread.
-
markAsReadByUser
final static Thread markAsReadByUser(Thread $self, ThreadInfo threadInfo, User user, Date createdAt)
Marks the given thread as read by the given user.
- Parameters:
threadInfo- The ThreadInfo holding info about the Thread which should be marked as read.user- The User for which the thread should be marked as read.createdAt- The Date of the 'mark read' event.
-
applyThreadUpdatedEventChanges
final static Thread applyThreadUpdatedEventChanges(Thread $self, ThreadInfo threadInfo)
Applies the updated thread info from a
thread.updatedevent to this Thread. Thethread.updatedevent is emitted when a thread is partially updated via the API.IMPORTANT: Use only to update the Thread data from a
thread.updatedevent.Only
titleandextraData(custom data) can be updated via theUpdateThreadPartialendpoint. TheupdatedAttimestamp is also applied as it reflects the server-managed update time.- Parameters:
threadInfo- The ThreadInfo holding the updated thread data.
-
markAsUnreadByUser
final static Thread markAsUnreadByUser(Thread $self, User user, Date createdAt)
Marks the given thread as unread by the given user.
- Parameters:
user- The User for which the thread should be marked as read.createdAt- The Date of the 'mark read' event.
-
-
-
-