Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Allow Python interface to access IRCv3 information #2256

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Yaulendil
Copy link

A small change to forward IRCv3 information received by Hexchat to Python scripts that request it. This addresses, though perhaps not fully, #1393.

In Python, the function passed to hexchat.hook_server_attrs() now receives the IRCv3 message as a string under the Attribute object, as Attribute.ircv3. This should not break any Python addons, unless they call dir(Attribute) and expect a very specific return value (I do not know of any that do).

It does not affect any of the other scripting interfaces because I dont know those interfaces as well.
It does not allow Python to access the IRCv3 information through hexchat.hook_print_attrs() because I wanted, at least at first, to keep my edits to the code minimal.

I have been running this fork for a week now, with an addon that heavily utilizes the change, and it seems to be quite stable.

@TingPing
Copy link
Member

I strongly dislike just shoving the line in there and calling it a day. If we want to expose raw tags it should be in a hash table or so.

@SoniEx2
Copy link

SoniEx2 commented Oct 13, 2018

It's a good idea to make the raw string available as well, in case anyone relies on the wire-order for some reason. Mainly nonstandard/noncompliant stuff.

@Yaulendil
Copy link
Author

While I do see the value of the raw string being available, I do agree that it would probably be more performant to be done as a hash table in C, so that plugins dont need to spend time splitting the string up themselves.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants