-
- All Implemented Interfaces:
public final class ChannelKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static MessagelastMessage
-
Method Summary
Modifier and Type Method Description final MessagegetLastMessage()final static List<User>users(Channel $self)Returns all users including watchers of a channel that are associated with it. final static UnitupdateLastMessage(Channel $self, Message message)final static ChannelremoveMember(Channel $self, String memberUserId)Removes member from the Channel.members and aligns Channel.memberCount. final static ChanneladdMember(Channel $self, Member member)Adds member to the Channel.members and aligns Channel.memberCount. final static ChannelupdateMember(Channel $self, Member member)Updates Channel member. final static ChannelupdateMemberBanned(Channel $self, String memberUserId, Boolean banned, Boolean shadow)Updates Member.banned property inside the Channel.members. final static ChanneladdMembership(Channel $self, String currentUserId, Member member)Sets Channel.membership to member if currentUserId equals to member.user. final static ChannelupdateMembership(Channel $self, Member member)Sets Channel.membership to member if member.user. final static ChannelupdateMembershipBanned(Channel $self, String memberUserId, Boolean banned)Sets Channel.membership. final static ChannelremoveMembership(Channel $self, String currentUserId)Sets Channel.membership to null if currentUserId equals to membership.user. final static UnitupdateReads(Channel $self, ChannelUserRead newRead)final static UnitincrementUnreadCount(Channel $self, String currentUserId, Date lastMessageSeenDate)Increments channel's unread for the specific user. final static List<Channel>applyPagination(Collection<Channel> $self, AnyChannelPaginationRequest pagination)final static List<Channel>updateUsers(Collection<Channel> $self, Map<String, User> users)Updates collection of channels with more recent data of users. -
-
Method Detail
-
getLastMessage
final Message getLastMessage()
-
users
final static List<User> users(Channel $self)
Returns all users including watchers of a channel that are associated with it.
-
updateLastMessage
final static Unit updateLastMessage(Channel $self, Message message)
-
removeMember
final static Channel removeMember(Channel $self, String memberUserId)
Removes member from the Channel.members and aligns Channel.memberCount.
- Parameters:
memberUserId- User id of the removed member.
-
addMember
final static Channel addMember(Channel $self, Member member)
Adds member to the Channel.members and aligns Channel.memberCount.
- Parameters:
member- Added member.
-
updateMember
final static Channel updateMember(Channel $self, Member member)
Updates Channel member.
- Parameters:
member- Updated member.
-
updateMemberBanned
final static Channel updateMemberBanned(Channel $self, String memberUserId, Boolean banned, Boolean shadow)
Updates Member.banned property inside the Channel.members.
- Parameters:
memberUserId- Updated member user id.banned- Shows whether a user is banned or not in this channel.shadow- Shows whether a user is shadow banned or not in this channel.
-
addMembership
final static Channel addMembership(Channel $self, String currentUserId, Member member)
Sets Channel.membership to member if currentUserId equals to member.user.id.
- Parameters:
currentUserId- User id of the currently logged in user.member- Added member.
-
updateMembership
final static Channel updateMembership(Channel $self, Member member)
Sets Channel.membership to member if member.user.id equals to Channel.membership.user.id.
- Parameters:
member- Updated member.
-
updateMembershipBanned
final static Channel updateMembershipBanned(Channel $self, String memberUserId, Boolean banned)
Sets Channel.membership.banned to banned if memberUserId equals to membership.user.id.
- Parameters:
memberUserId- Member user id.banned- Shows whether a user is banned or not in this channel.
-
removeMembership
final static Channel removeMembership(Channel $self, String currentUserId)
Sets Channel.membership to null if currentUserId equals to membership.user.id.
- Parameters:
currentUserId- User id of the currently logged in user.
-
updateReads
final static Unit updateReads(Channel $self, ChannelUserRead newRead)
-
incrementUnreadCount
final static Unit incrementUnreadCount(Channel $self, String currentUserId, Date lastMessageSeenDate)
Increments channel's unread for the specific user.
- Parameters:
currentUserId- The id of the user that should have the unread count incremented for this Channel.lastMessageSeenDate- The Date of the last message that the SDK is aware of.
-
applyPagination
final static List<Channel> applyPagination(Collection<Channel> $self, AnyChannelPaginationRequest pagination)
-
updateUsers
final static List<Channel> updateUsers(Collection<Channel> $self, Map<String, User> users)
Updates collection of channels with more recent data of users.
-
-
-
-