Class ChannelKt
-
- 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 ChannelupdateLastMessage(Channel $self, Date receivedEventDate, Message message, String currentUserId)Updates the Channel with newest 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. 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 ChannelupdateReads(Channel $self, ChannelUserRead newRead, String currentUserId)Updates the Channel with a new ChannelUserRead. final static List<Channel>applyPagination(Collection<Channel> $self, AnyChannelPaginationRequest pagination)Transforms the given Collection of Channels by applying the given AnyChannelPaginationRequest. final static List<Channel>updateUsers(Collection<Channel> $self, Map<String, User> users)Updates collection of channels with more recent data of users. final static Collection<Channel>updateLiveLocations(Collection<Channel> $self, List<Location> locations)Updates the live locations of the channels with the provided locations. -
-
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 Channel updateLastMessage(Channel $self, Date receivedEventDate, Message message, String currentUserId)
Updates the Channel with newest Message.
- Parameters:
receivedEventDate- Date when the event which updates the message was received.message- New message to update the channel with.currentUserId- User id of the currently logged in user.
-
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.getUserId().
- 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 Channel.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 Channel updateReads(Channel $self, ChannelUserRead newRead, String currentUserId)
Updates the Channel with a new ChannelUserRead. If an existing read for the user already exists, it will be replaced with the new one. If not, the new read will be added to the list of reads.
- Parameters:
newRead- New read to update the channel with.currentUserId- User id of the currently logged in user.
-
applyPagination
final static List<Channel> applyPagination(Collection<Channel> $self, AnyChannelPaginationRequest pagination)
Transforms the given Collection of Channels by applying the given AnyChannelPaginationRequest.
-
updateUsers
final static List<Channel> updateUsers(Collection<Channel> $self, Map<String, User> users)
Updates collection of channels with more recent data of users.
-
updateLiveLocations
final static Collection<Channel> updateLiveLocations(Collection<Channel> $self, List<Location> locations)
Updates the live locations of the channels with the provided locations.
-
-
-
-