Skip to content

Commit

Permalink
* Dissolve the code from IrcDaemon in the corresponding commands
Browse files Browse the repository at this point in the history
* DB Rename table
* Register User and Nick Message finished

git-svn-id: https://svn.origo.ethz.ch/ircddotnet/trunk@25 3fea7bcf-81c2-4a08-a3b7-d3cc9173df77
  • Loading branch information
FreeApophis committed May 31, 2010
1 parent 3a9f331 commit 18658ab
Show file tree
Hide file tree
Showing 21 changed files with 950 additions and 922 deletions.
20 changes: 20 additions & 0 deletions IrcD.Net/Commands/Away.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,23 @@ public override void Handle(UserInfo info, List<string> args)
}
}
}

//private void AwayDelegate(UserInfo info, List<string> args)
//{
// if (!info.Registered)
// {
// SendNotRegistered(info);
// return;
// }

// if (args.Count == 0)
// {
// info.AwayMsg = null;
// SendUnAway(info);
// }
// else
// {
// info.AwayMsg = args[0];
// SendNowAway(info);
// }
//}
4 changes: 1 addition & 3 deletions IrcD.Net/Commands/CommandList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using IrcD.Utils;

Expand Down Expand Up @@ -65,7 +63,7 @@ public void Handle(string command, UserInfo info, List<string> args)
var parsedLine = new StringBuilder();
parsedLine.Append("[" + info.Usermask + "]-[" + command + "]");

foreach (string arg in args)
foreach (var arg in args)
{
parsedLine.Append("-<" + arg + ">");
}
Expand Down
22 changes: 22 additions & 0 deletions IrcD.Net/Commands/IsOn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,25 @@ public override void Handle(UserInfo info, List<string> args)
}
}
}

//private void IsonDelegate(UserInfo info, List<string> args)
//{
// if (!info.Registered)
// {
// SendNotRegistered(info);
// return;
// }
// if (args.Count < 1)
// {
// SendNeedMoreParams(info);
// return;
// }

// var nickList = new List<string>();
// foreach (string nick in args)
// {
// if (nicks.ContainsKey(nick))
// nickList.Add(nick);
// }
// SendIsOn(info, nickList);
//}
121 changes: 121 additions & 0 deletions IrcD.Net/Commands/Join.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,124 @@ public override void Handle(UserInfo info, List<string> args)
}
}
}

//internal void JoinDelegate(UserInfo info, List<string> args)
//{
// if (!info.Registered)
// {
// SendNotRegistered(info);
// return;
// }
// if (args.Count < 1)
// {
// SendNeedMoreParams(info);
// return;
// }
// if (args[0] == "0")
// {
// var partargs = new List<string>();
// // this is a part all channels, this is plainly stupid to handle PARTS in a join message.
// // we won't handle that, we give it to the part handler! YO! why not defining a /part * instead of /join 0
// commandSB.Length = 0; bool first = true;
// foreach (ChannelInfo ci in info.Channels.Select(upci => upci.ChannelInfo))
// {
// if (first)
// {
// first = false;
// }
// else
// {
// commandSB.Append(",");
// }
// commandSB.Append(ci.Name);
// }
// partargs.Add(commandSB.ToString());
// partargs.Add("Left all channels");
// PartDelegate(info, partargs);
// return;
// }

// IEnumerable<string> keys;
// if (args.Count > 1)
// {
// keys = GetSubArgument(args[1]);
// }
// else
// {
// keys = new List<string>();
// }

// foreach (string ch in GetSubArgument(args[0]))
// {
// ChannelInfo chan;
// if (channels.ContainsKey(ch))
// {
// chan = channels[ch];
// // TODO: new modes
// // Check for (+l)
// //if ((chan.Mode_l != -1) && (chan.Mode_l <= chan.User.Count))
// //{
// // SendChannelIsFull(info, chan);
// // return;
// //}

// // Check for (+k)
// //if (!string.IsNullOrEmpty(chan.Mode_k))
// //{
// // bool j = false;
// // foreach (string key in keys)
// // {
// // if (key == chan.Mode_k)
// // {
// // j = true;
// // }
// // }
// // if (!j)
// // {
// // SendBadChannelKey(info, chan);
// // return;
// // }
// //}

// // Check for (+i)
// //if (chan.Mode_i)
// //{
// // // TODO: implement invite
// // SendInviteOnlyChannel(info, chan);
// //}

// // Check for (+b) (TODO)
// if (false)
// {
// SendBannedFromChannel(info, chan);
// }
// }
// else
// {
// chan = new ChannelInfo(ch, this);
// channels.Add(chan.Name, chan);
// }

// var chanuser = new UserPerChannelInfo(info, chan);
// chan.Users.Add(info.Nick, chanuser);
// info.Channels.Add(chanuser);

// foreach (UserPerChannelInfo upci in chan.Users.Values)
// {
// SendJoin(info, upci.UserInfo, chan);
// }


// if (string.IsNullOrEmpty(chan.Topic))
// {
// SendNoTopicReply(info, chan);
// }
// else
// {
// SendTopicReply(info, chan);
// }
// SendNamesReply(chanuser.UserInfo, chan);
// SendEndOfNamesReply(info, chan);
// }

//}
15 changes: 15 additions & 0 deletions IrcD.Net/Commands/List.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,18 @@ public override void Handle(UserInfo info, List<string> args)
}
}
}

//private void ListDelegate(UserInfo info, List<string> args)
//{
// if (!info.Registered)
// {
// SendNotRegistered(info);
// return;
// }
// // TODO: special LIST commands / implemented is full list
// foreach (ChannelInfo ci in channels.Values)
// {
// SendListItem(info, ci);
// }
// SendListEnd(info);
//}
Loading

0 comments on commit 18658ab

Please sign in to comment.