]> jfr.im git - irc.git/blob - software/RELEASES/ircservices/achurch.org/services/lists/ircservices-coding/2005/003137.html
rename -> *.git
[irc.git] / software / RELEASES / ircservices / achurch.org / services / lists / ircservices-coding / 2005 / 003137.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> [IRCServices Coding] Introduced module's Psuedoclient is invalid
5 user.
6 </TITLE>
7 <LINK REL="Index" HREF="index.html" >
8 <LINK REL="made" HREF="mailto:ircservices-coding%40ircservices.esper.net?Subject=%5BIRCServices%20Coding%5D%20Introduced%20module%27s%20Psuedoclient%20is%20invalid%0A%09user.&In-Reply-To=43007C70.7060500%40gmail.com">
9 <META NAME="robots" CONTENT="index,nofollow">
10 <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
11 <LINK REL="Previous" HREF="003140.html">
12 <LINK REL="Next" HREF="003141.html">
13 </HEAD>
14 <BODY BGCOLOR="#ffffff">
15 <H1>[IRCServices Coding] Introduced module's Psuedoclient is invalid
16 user.</H1>
17 <B>Andrew Church</B>
18 <A HREF="mailto:ircservices-coding%40ircservices.esper.net?Subject=%5BIRCServices%20Coding%5D%20Introduced%20module%27s%20Psuedoclient%20is%20invalid%0A%09user.&In-Reply-To=43007C70.7060500%40gmail.com"
19 TITLE="[IRCServices Coding] Introduced module's Psuedoclient is invalid
20 user.">achurch at achurch.org
21 </A><BR>
22 <I>Mon Aug 15 21:36:33 PDT 2005</I>
23 <P><UL>
24 <LI>Previous message: <A HREF="003140.html">[IRCServices Coding] Introduced module's Psuedoclient is invalid
25 user.
26 </A></li>
27 <LI>Next message: <A HREF="003141.html">[IRCServices Coding] channel modes bug report
28 </A></li>
29 <LI> <B>Messages sorted by:</B>
30 <a href="date.html#3137">[ date ]</a>
31 <a href="thread.html#3137">[ thread ]</a>
32 <a href="subject.html#3137">[ subject ]</a>
33 <a href="author.html#3137">[ author ]</a>
34 </LI>
35 </UL>
36 <HR>
37 <!--beginarticle-->
38 <PRE> What you need to do in this case is keep track of the pseudoclients'
39 status yourself, like how the autokick code keeps track of which channels
40 ChanServ is in. The User structure is for users monitored by Services, not
41 for pseudoclients.
42
43 --Andrew Church
44 <A HREF="http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding">achurch at achurch.org</A>
45 <A HREF="http://achurch.org/">http://achurch.org/</A>
46
47 &gt;<i>Aha - let me guess, you're working on a botserv? ;)
48 </I>&gt;<i>
49 </I>&gt;<i>Alas, it's not that simple, Services doesn't know about users on their
50 </I>&gt;<i>own server (chanserv, nickserv and any other pseudoclients). So really,
51 </I>&gt;<i>there isn't a way to accomplish this, at least, not easily that we've
52 </I>&gt;<i>been able to think of yet. (myself craig, and brain did some
53 </I>&gt;<i>brainstorming on this a while back (last year?), can't remember what we
54 </I>&gt;<i>ended up thinking.
55 </I>&gt;<i>
56 </I>&gt;<i>Olly wrote:
57 </I>&gt;&gt;<i> Hi
58 </I>&gt;&gt;<i> I seem to have screwed up somewhere, but can't see where.
59 </I>&gt;&gt;<i> I have stolen module code, from a module coded by ChatSpike.net (Thanks
60 </I>&gt;&gt;<i> Brain and the crew) and have modified it a little.
61 </I>&gt;&gt;<i> The problem is when I try to discover what the psuedoclient's channel
62 </I>&gt;&gt;<i> status is. All I get in the debug logs is a request has been made for an
63 </I>&gt;&gt;<i> &quot;invalid user&quot;. If I attempt to discover any info using any of the
64 </I>&gt;&gt;<i> call-backs, I either get a seg fault or no reply. I imagine this is due
65 </I>&gt;&gt;<i> to the pseudoclient's Nick not having any valid user. The kind of info I
66 </I>&gt;&gt;<i> am after is whether the Psuedoclient is opped in any particular channel,
67 </I>&gt;&gt;<i> or if it has been kicked. None of the call-backs will give me any of
68 </I>&gt;&gt;<i> this info, and direct use of the standard APIs like:
69 </I>&gt;&gt;<i>
70 </I>&gt;&gt;<i> is_chanop(User *user, const char *chan)
71 </I>&gt;&gt;<i>
72 </I>&gt;&gt;<i> causes a crash because get_user(PsuedoclientNick) returns NULL I expect.
73 </I>&gt;&gt;<i>
74 </I>&gt;&gt;<i> I even attempted to add a custom is_chanop routine to the module which
75 </I>&gt;&gt;<i> searched using just the nick but then
76 </I>&gt;&gt;<i>
77 </I>&gt;&gt;<i> LIST_SEARCH(c-&gt;users, user-&gt;nick, user-&gt;nick, irc_stricmp, cu);
78 </I>&gt;&gt;<i>
79 </I>&gt;&gt;<i> gave me a problem because it too requires a valid user to work with, and
80 </I>&gt;&gt;<i> all I can seem to provide is just a nick.
81 </I>&gt;&gt;<i>
82 </I>&gt;&gt;<i> do_intoduce appears to work correctly yet CS still alters the channel
83 </I>&gt;&gt;<i> status of the module's pseudoclient despite it's being a Services User.
84 </I>&gt;&gt;<i>
85 </I>&gt;&gt;<i> Here's the beginning code for do_introduce which is taken directly from
86 </I>&gt;&gt;<i> Chatspike's module.
87 </I>&gt;&gt;<i>
88 </I>&gt;&gt;<i> static int do_introduce(const char *nick)
89 </I>&gt;&gt;<i> {
90 </I>&gt;&gt;<i> ChannelInfo *ci;static int do_introduce(const char *nick)
91 </I>&gt;&gt;<i> char chan[1024];
92 </I>&gt;&gt;<i> FILE* f;
93 </I>&gt;&gt;<i> if (!nick || irc_stricmp(nick, s_ModuleNick) == 0) {
94 </I>&gt;&gt;<i> send_nick(s_IdleServ, ServiceUser, ServiceHost,
95 </I>&gt;&gt;<i> ServerName,
96 </I>&gt;&gt;<i> desc_IdleServ, pseudoclient_modes);
97 </I>&gt;&gt;<i> if (nick)
98 </I>&gt;&gt;<i> return 1;
99 </I>&gt;&gt;<i>
100 </I>&gt;&gt;<i> Any ideas/help appreciated.
101 </I>&gt;&gt;<i>
102 </I>&gt;&gt;<i> Thanks.
103 </I>&gt;&gt;<i>
104 </I>&gt;&gt;<i> Olly
105 </I>&gt;&gt;<i>
106 </I>&gt;&gt;<i>
107 </I>&gt;&gt;<i>
108 </I>&gt;&gt;<i>
109 </I>&gt;&gt;<i> ------------------------------------------------------------------------
110 </I>&gt;&gt;<i>
111 </I>&gt;&gt;<i> ------------------------------------------------------------------
112 </I>&gt;&gt;<i> To unsubscribe or change your subscription options, visit:
113 </I>&gt;&gt;<i> <A HREF="http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding">http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding</A>
114 </I>&gt;<i>
115 </I>&gt;<i>------------------------------------------------------------------
116 </I>&gt;<i>To unsubscribe or change your subscription options, visit:
117 </I>&gt;<i><A HREF="http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding">http://lists.ircservices.za.net/mailman/listinfo/ircservices-coding</A>
118 </I></PRE>
119
120
121
122
123
124 <!--endarticle-->
125 <HR>
126 <P><UL>
127 <!--threads-->
128 <LI>Previous message: <A HREF="003140.html">[IRCServices Coding] Introduced module's Psuedoclient is invalid
129 user.
130 </A></li>
131 <LI>Next message: <A HREF="003141.html">[IRCServices Coding] channel modes bug report
132 </A></li>
133 <LI> <B>Messages sorted by:</B>
134 <a href="date.html#3137">[ date ]</a>
135 <a href="thread.html#3137">[ thread ]</a>
136 <a href="subject.html#3137">[ subject ]</a>
137 <a href="author.html#3137">[ author ]</a>
138 </LI>
139 </UL>
140
141 </body></html>