public static FriendUnblockR ( Aura.Msgr.Database.User user, bool success, int friendId ) : void | ||
user | Aura.Msgr.Database.User | |
success | bool | |
friendId | int | Only required on success. |
return | void |
public void FriendUnblock(MsgrClient client, Packet packet) { var contactId = packet.GetInt(); // Check friend var friend = client.User.GetFriend(contactId); if (friend == null) { Log.Warning("FriendUnblock: User '{0}' tried to block invalid friend.", client.User.AccountId); return; } // Check status if (friend.FriendshipStatus != FriendshipStatus.Blocked) { Send.FriendUnblockR(client.User, false, contactId); return; } // Change status friend.FriendshipStatus = FriendshipStatus.Normal; MsgrServer.Instance.Database.SetFriendshipStatusOneSided(client.User.Id, contactId, friend.FriendshipStatus); Send.FriendUnblockR(client.User, true, contactId); // Live update var friendUser = MsgrServer.Instance.UserManager.Get(contactId); if (friendUser != null) { Send.FriendOnline(friendUser, client.User); } }