public override void Execute() { User user = _persistance.GetUserFromIdent(_ident); if (!string.IsNullOrEmpty(user.Vhost)) { var vhostOperCommmand = VhostOperCommmand.SetVhost(_nick, user.Vhost); OperCommands.Add(vhostOperCommmand); } if (user.AutoJoin) { foreach (var group in user.Groups) { if (!string.IsNullOrEmpty(group.Channel)) { var sajoinOperCommmand = SajoinOperCommmand.SetSaJoin(_nick, group.Channel); OperCommands.Add(sajoinOperCommmand); if (group.GroupAdmins.Contains(user)) { var saModeOpsOperCommmand = SaModeOpsOperCommmand.SetSamode(_nick, group.Channel); OperCommands.Add(saModeOpsOperCommmand); } } } } }
public override void Execute() { foreach (WhoInfo who in _nickInfo) { var operCommand = KillOperCommmand.SetKill(who.Nick); OperCommands.Add(operCommand); } string nicks = string.Join(", ", _nickInfo.Select(s => s.Nick)); Messages.Add(string.Format("Killed the following nick(s): {0}", nicks)); }
public override void Execute() { User user = _persistance.GetUserInfo(Context.Ident); foreach (var group in user.Groups) { if (!string.IsNullOrEmpty(group.Channel)) { var sajoinCommand = SajoinOperCommmand.SetSaJoin(Context.User, group.Channel); OperCommands.Add(sajoinCommand); if (group.GroupAdmins.Contains(user)) { var saModeCommand = SaModeOpsOperCommmand.SetSamode(Context.User, group.Channel); OperCommands.Add(saModeCommand); } } } }
public override void Execute() { User user = _persistance.GetUserInfo(Mapping[SetHostArguments.Username]); List <string> nicks = _ircReadWriteExchange.GetWhoList().Where(i => i.Ident == user.Name).Select(n => n.Nick).ToList(); if (nicks.Count == 0) { Messages.Add(string.Format("Can't change hostname, user {0} is currently offline", Mapping[SetHostArguments.Username])); } else { foreach (string nick in nicks) { var command = VhostOperCommmand.SetVhost(nick, user.Vhost); OperCommands.Add(command); } string processednicks = string.Join(" ,", nicks); Messages.Add(string.Format("Executing hostname change for user {0}, affected nick(s) {1}", Mapping[SetHostArguments.Username], processednicks)); } }
public override void Execute() { _persistance.DeleteUser(Mapping[DeleteKillUserArguments.Username]); Messages.Add(string.Format("User {0} succesfully deleted.", Mapping[DeleteKillUserArguments.Username])); var info = _ircReadWriteExchange.GetWhoList().Where(u => String.Equals(u.Ident, Mapping[DeleteKillUserArguments.Username], StringComparison.InvariantCultureIgnoreCase)).ToList(); if (info.Any()) { foreach (var who in info) { var command = KillOperCommmand.SetKill(who.Nick); OperCommands.Add(command); } string nicks = string.Join(", ", info.Select(s => s.Nick)); Messages.Add(string.Format("Killed the following nick(s): {0}", nicks)); } else { Messages.Add(string.Format("No nicks killed, user {0} wasn't online.", Mapping[DeleteKillUserArguments.Username])); } }
public override void Execute() { var operCommand = SaModeOperCommmand.SetSamode(Mapping[SaModeArguments.Nick], Mapping[SaModeArguments.Mode], Mapping[SaModeArguments.Channel]); OperCommands.Add(operCommand); }