IsBanned() публичный Метод

public IsBanned ( string name ) : bool
name string
Результат bool
Пример #1
0
        public async void HandleMessage(Room room, Message message)
        {
            var chatLine = message.Line as ChatLine;
            if (chatLine == null || chatLine.SenderId == "0")
                return;

            await Task.Yield();

            var senderId = long.Parse(chatLine.SenderId);

            var recipientDevices = Notifications
                .Where(n => n.UserId != senderId && !room.IsBanned(n.Name) && n.Rooms.Contains(chatLine.Chat))
                .Where(n => IsMatch(n.Regex, chatLine.Content))
                .Select(n => n.DeviceToken)
                .ToList();

            if (recipientDevices.Count > 0)
            {
                var content = $"[{chatLine.Chat}] {WebUtility.HtmlDecode(chatLine.Sender)}: {WebUtility.HtmlDecode(chatLine.Content)}";
                await Notify(recipientDevices, content);
            }
        }
Пример #2
0
 private static string GetRankString(Room room, string username)
 {
     if (Util.IsAdmin(room, username))
         return "Administrator";
     if (Util.IsMod(room, username))
         return "Moderator";
     if (room.IsBanned(username))
         return "Guest";
     return "Member";
 }