Opened 16 years ago

Last modified 16 years ago

#1484 defect closed invalid (invalid)

small bug in twisted irc

Reported by: inhahe Owned by:
Priority: high Milestone:
Component: words Keywords: documentation
Cc: Jean-Paul Calderone, inhahe Branch:


Change History (5)

comment:1 Changed 16 years ago by inhahe

In, line 990, function irc_JOIN:

    def irc_JOIN(self, prefix, params):
        nick = string.split(prefix,'!')[0]
        channel = params[-1]
        if nick == self.nickname:
            self.userJoined(nick, channel)

self.userJoined(nick, channel) should be self.userJoined(prefix, channel)

self.userJoined is defined as taking a user parameter and not a nick 
parameter, which it should, so the whole nick!ident@host should be there.

comment:2 Changed 16 years ago by Jean-Paul Calderone

What does "user" mean?  It's nice and vague.  I'm inclined to improve the
documentation of userJoined (and every other callback that takes a nickname),
not change the behavior in an incompatible manner.

Note that "user" is what most of the callbacks take, and they're all actually
invoked with a nickname.

comment:3 Changed 16 years ago by inhahe

in other functions (privmsg, action) 'user' means the whole nick!ident@hostname
deal, but i guess that's not universal.  in the functions i've used so far
userJoined is the one that stands out in that it doesn't give you all the
information one would expect which the irc server actually supplies.  i actually
needed this information for my bot. (so for myself i already changed 
So, i thnk it would be more sensible for it to pass prefix (which will be
nick!ident@hostname), but i have nothing to say about the incompatibility deal..

comment:4 Changed 16 years ago by Jean-Paul Calderone

You could override irc_JOIN instead of userJoined.

FWIW, I agree this is valuable information, but the backwards compatibility
thing pretty much kills it.

I think when I next have a chance to work on Twisted's IRC support, I am going
to introduce some totally new APIs which can be awesome and not constrained by
backwards compatibility concerns.

comment:5 Changed 11 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.