fix some formatting
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Ben Harris 2020-05-14 23:50:06 -04:00
parent 21f1e95fb8
commit d3600ce568
Signed by: ben
GPG Key ID: 4E0AF802FFF7960C
3 changed files with 12 additions and 25 deletions

View File

@ -51,7 +51,7 @@ namespace IRCStates
var value = string.Empty;
if (split.Length > 1)
{
value = split[1];
value = split[1];
Raw[key] = value;
}

View File

@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Globalization;
using System.Linq;
using IRCTokens;
@ -12,7 +11,7 @@ namespace IRCStates
public const string WhoType = "525"; // randomly generated
private readonly StatefulDecoder _decoder;
private Dictionary<string, string> TempCaps;
private readonly Dictionary<string, string> TempCaps;
public Server(string name)
{
@ -168,10 +167,7 @@ namespace IRCStates
var channelUser = channel.Users[nicknameLower];
if (add)
{
if (!channelUser.Modes.Contains(c))
{
channelUser.Modes.Add(c);
}
if (!channelUser.Modes.Contains(c)) channelUser.Modes.Add(c);
}
else if (channelUser.Modes.Contains(c))
{
@ -555,19 +551,16 @@ namespace IRCStates
target = target.Substring(1);
}
else
{
break;
}
}
emit.Target = line.Params[0];
if (IsChannel(target) && HasChannel(target))
{
emit.Channel = Channels[CaseFold(target)];
}
else if (IsMe(target))
{
emit.SelfTarget = true;
}
emit.Channel = Channels[CaseFold(target)];
else if (IsMe(target)) emit.SelfTarget = true;
return emit;
}
@ -578,9 +571,7 @@ namespace IRCStates
.TrimStart('+')
.Select(m => m.ToString(CultureInfo.InvariantCulture))
.Where(m => !Modes.Contains(m)))
{
Modes.Add(c);
}
return new Emit();
}
@ -614,7 +605,6 @@ namespace IRCStates
var tokens = new List<string>();
foreach (var c in modeString)
{
if (new[] {'+', '-'}.Contains(c))
{
modifier = c;
@ -624,7 +614,6 @@ namespace IRCStates
modes.Add((modifier == '+', c.ToString(CultureInfo.InvariantCulture)));
tokens.Add($"{modifier}{c}");
}
}
emit.Tokens = tokens;
@ -632,11 +621,9 @@ namespace IRCStates
{
emit.SelfTarget = true;
foreach (var (add, c) in modes)
{
if (add && !Modes.Contains(c))
Modes.Add(c);
else if (Modes.Contains(c)) Modes.Remove(c);
}
}
else if (HasChannel(target))
{