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

Robin Burchell surreal.w00t at gmail.com
Mon Aug 15 04:28:48 PDT 2005


Aha - let me guess, you're working on a botserv? ;)

Alas, it's not that simple, Services doesn't know about users on their 
own server (chanserv, nickserv and any other pseudoclients). So really, 
there isn't a way to accomplish this, at least, not easily that we've 
been able to think of yet. (myself craig, and brain did some 
brainstorming on this a while back (last year?), can't remember what we 
ended up thinking.

Olly wrote:
> 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
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------
> To unsubscribe or change your subscription options, visit:
> http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding