public void AcceptFriend(ButtonClickEvent e, SingleNode <AcceptFriendRequestButtonComponent> button, [JoinByUser] IncomingFriendNode incomingFriend, [JoinAll] SingleNode <SelfUserComponent> selfUser, [JoinAll] SingleNode <FriendsScreenComponent> friendsScreen, [JoinAll] ICollection <IncomingFriendNode> incomingFriends) { base.ScheduleEvent(new AcceptFriendEvent(incomingFriend.Entity), selfUser); friendsScreen.component.RemoveUser(incomingFriend.Entity.Id, false); friendsScreen.component.AddItem(incomingFriend.Entity.Id, incomingFriend.userUid.Uid, FriendType.Accepted); if (incomingFriends.Count > 1) { friendsScreen.component.AcceptFriend(); } else { friendsScreen.component.ResetButtons(); } }
public void RejectFriend(ButtonClickEvent e, SingleNode <DeclineFriendRequestButtonComponent> button, [JoinByUser] IncomingFriendNode incommingFriend, [JoinAll] SingleNode <SelfUserComponent> selfUser, [JoinAll] SingleNode <FriendsScreenComponent> friendsScreen, [JoinAll] ICollection <IncomingFriendNode> incomingFriends) { base.ScheduleEvent(new RejectFriendEvent(incommingFriend.Entity), selfUser); friendsScreen.component.RemoveUser(incommingFriend.Entity.Id, true); friendsScreen.component.RejectFriend(); if (incomingFriends.Count > 1) { friendsScreen.component.RejectFriend(); } else { friendsScreen.component.ResetButtons(); } }
public void ShowIncomingFriendButtons(NodeAddedEvent e, IncomingFriendNode friend, [JoinByUser, Context, Combine] FriendLabelNode userLabel) { userLabel.incomingFriendButtons.IsIncoming = true; }