Package 

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 Thread updateParentOrReply(Thread $self, Message message) Updates the given Thread with the new message (parent or reply).
      final static Thread updateParent(Thread $self, Message parent) Updates the parent message of a Thread.
      final static Thread upsertReply(Thread $self, Message reply) Inserts a new reply (or updates and existing one) in a Thread.
      final static Thread markAsReadByUser(Thread $self, ThreadInfo threadInfo, User user, Date createdAt) Marks the given thread as read by the given user.
      final static Thread applyThreadUpdatedEventChanges(Thread $self, ThreadInfo threadInfo) Applies the updated thread info from a thread.updated event to this Thread.
      final static Thread markAsUnreadByUser(Thread $self, User user, Date createdAt) Marks the given thread as unread by the given user.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.updated event to this Thread. The thread.updated event is emitted when a thread is partially updated via the API.

        IMPORTANT: Use only to update the Thread data from a thread.updated event.

        Only title and extraData (custom data) can be updated via the UpdateThreadPartial endpoint. The updatedAt timestamp 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.