meebey / SmartIrc4net

IRC C# Library
http://www.meebey.net/projects/smartirc4net/
Other
126 stars 52 forks source link

Inbound tags for IRCv3 #45

Closed gmt2001 closed 8 years ago

gmt2001 commented 8 years ago

These commits add support for inbound IRCv3 tags. Applications can access them from the IrcMessageData.Tags property, which is a Dictionary indexed by tag name. The raw tags string is also available from IrcMessageData.RawTags.

NOTE: My branch has starksoftproxy updated to d03786d

meebey commented 8 years ago

Please adjust your code to follow the coding standards used by the library. Mostly the newlines of control paths needs a fixup. For example code that follows the CS see https://github.com/meebey/smuxi/blob/master/HACKING.md

gmt2001 commented 8 years ago

As far as the RawTags goes, I was removing the tags from the RawMessage when I parsed it so that your parsing of the line would not need to be changed, since it relied on the first character of the raw message being a colon in order to properly parse the nick, thus I wanted to provide a way for the user to re-parse it themselves if they desired. If you'd like I can prepend it back into the raw message on the line that calls the IrcMessageData constructor and then remove the separate RawTags field

I am working on the other issues now

meebey commented 8 years ago

@gmt2001 wrote:

If you'd like I can prepend it back into the raw message on the line that calls the IrcMessageData constructor and then remove the separate RawTags field

Yes, please retain the original string for the RawMessage property. That the lib simply strips the : from RawMessage proptery is already a bug IMHO. The purpose of that property is to contain whatever was received from the server in verbatim form. RawTags property should be dropped then.

I will not merge the startsoftproxy bump as the CI fails because the CI supports .NET 4.0, have to check how to move that to .NET 4.5

meebey commented 8 years ago

@gmt2001 can you tell me an IRC network that does use tags so I can test this patch?

gmt2001 commented 8 years ago

Twitch.tv does for sure if you send CAP REQ :twitch.tv/tags If you then join the channel of an active Twitch channel it should add tags to all PRIVMSG You can login as justinfan752385723 to get a receive/JOIN/PART only connection (password not required, if that name is taken just change the numbers) and search for a channel to join on https://www.twitch.tv/directory

meebey commented 8 years ago

Merged with some changes. Thanks for your contribution!