internal void TriggerUsernameChanged(string oldUserName, jab.Models.User jabuser, bool isCurrentUser) { if (Name == oldUserName) { user.Name = jabuser.Name; user.Id = jabuser.Name; Name = user.Name; OnUsernameChanged(new UsernameChangedEventArgs(oldUserName, user, DateTimeOffset.Now)); OnNameChanged(EventArgs.Empty); Server.TriggerChannelInfoChanged(new ChannelEventArgs(this)); } else if (isCurrentUser) { OnUsernameChanged(new UsernameChangedEventArgs(oldUserName, Server.CurrentUser, DateTimeOffset.Now)); } }
internal void TriggerUsernameChanged(string oldUserName, jab.Models.User jabuser) { var user = GetUser(oldUserName); if (user != null) { lock (users) { if (users.ContainsKey(oldUserName)) { users.Remove(oldUserName); user.Name = jabuser.Name; user.Id = jabuser.Name; users.Add(user.Id, user); } } OnUsernameChanged(new UsernameChangedEventArgs(oldUserName, user, DateTimeOffset.Now)); } }
internal void TriggerOwnerRemoved(jab.Models.User user) { if (this.owners.Contains(user.Name)) { bool removed = false; lock (owners) { if (this.owners.Contains(user.Name)) { owners.Remove(user.Name); removed = true; } } if (removed) { OnOwnerRemoved(new UserEventArgs(new JabbRUser(this.Server, user), DateTimeOffset.Now)); } } }
private void UserLeft(JabbRUser user, string roomName) { var room = _rooms[roomName]; room.RemoveUser(user.Name); }
private void UserJoined(JabbRUser user, string roomName, bool isOwner) { var room = _rooms[roomName]; room.AddUser(User.Create(user)); }