[IRCServices Coding] Introduced module's Psuedoclient is invalid user.

Olly olly at avansys.co.uk
Mon Aug 15 04:09:08 PDT 2005


Hi
I seem to have screwed up somewhere, but can't see where.
I have stolen module code, from a module coded by ChatSpike.net (Thanks
Brain and the crew) and have modified it a little.
The problem is when I try to discover what the psuedoclient's channel
status is. All I get in the debug logs is a request has been made for an
"invalid user". If I attempt to discover any info using any of the
call-backs, I either get a seg fault or no reply. I imagine this is due
to the pseudoclient's Nick not having any valid user. The kind of info I
am after is whether the Psuedoclient is opped in any particular channel,
or if it has been kicked. None of the call-backs will give me any of
this info, and direct use of the standard APIs like:

is_chanop(User *user, const char *chan) 

causes a crash because get_user(PsuedoclientNick) returns NULL I expect.

I even attempted to add a custom is_chanop routine to the module which
searched using just the nick but then

    LIST_SEARCH(c->users, user->nick, user->nick, irc_stricmp, cu);

gave me a problem because it too requires a valid user to work with, and
all I can seem to provide is just a nick.

do_intoduce appears to work correctly yet CS still alters the channel
status of the module's pseudoclient despite it's being a Services User.

Here's the beginning code for do_introduce which is taken directly from
Chatspike's module.

static int do_introduce(const char *nick)
{
        ChannelInfo *ci;static int do_introduce(const char *nick)
        char chan[1024];
        FILE* f;
        if (!nick || irc_stricmp(nick, s_ModuleNick) == 0) {
                send_nick(s_IdleServ, ServiceUser, ServiceHost,
ServerName,
                desc_IdleServ, pseudoclient_modes);
                if (nick)
                    return 1;

Any ideas/help appreciated.

Thanks.

Olly

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Winmail.dat
Type: application/ms-tnef
Size: 5203 bytes
Desc: not available
Url : ../attachments/20050815/d6f8ffa0/Winmail-0001.bin