Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Part all channels  (Read 3682 times)

0 Members and 1 Guest are viewing this topic.

UnDeRGoD

  • Anope User
  • Offline Offline
  • Posts: 13
Part all channels
« on: May 03, 2007, 08:08:00 PM »

Cound you give me an example of how to create a function to make an user part all channels? PTlink IRCd dont support the /join 0 ... please help me
Logged

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #1 on: May 03, 2007, 08:43:00 PM »

go over all channels a user is in and use svspart on them... regular svspart is implemented in os_svsjoinpart, all you have to change is that it goes over all channels the user s on instead of a channel given in the command...

the module sounds abusive though...
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

UnDeRGoD

  • Anope User
  • Offline Offline
  • Posts: 13
(No subject)
« Reply #2 on: May 03, 2007, 08:46:41 PM »

But the problem is how to make the while listing the channels where's the user.

Isn't abusive, i will apply this on a force part all channel from guest nicks and then join in the #guests.
Logged

UnDeRGoD

  • Anope User
  • Offline Offline
  • Posts: 13
(No subject)
« Reply #3 on: May 04, 2007, 05:58:38 PM »

Help me please |:(
Logged

GhosT

  • Guest
(No subject)
« Reply #4 on: May 05, 2007, 09:34:20 AM »

UnDeRGoD:
In my opinion, it is IRCD thing. For UnrealIRCD, /join 0 = part all channel.
Logged

UnDeRGoD

  • Anope User
  • Offline Offline
  • Posts: 13
(No subject)
« Reply #5 on: May 05, 2007, 01:12:26 PM »

The PTlink IRCd support this but when i do:
send_cmd(s_OperServ, "SVSJOIN %s 0", na->nick);

appear this error: 0 No such channel

;(

[Edited on 5-5-2007 by UnDeRGoD]
Logged

katsklaw

  • Guest
(No subject)
« Reply #6 on: May 05, 2007, 02:02:50 PM »

UnDeRGoD, your only Anope based solution was presented to you by viper, there is nothing else we can do to help you.
Logged

Jan Milants

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1372
(No subject)
« Reply #7 on: May 06, 2007, 02:16:10 PM »

jfyi UnDeRGoD, just because JOIN 0 makes a users part all channels, doesn't mean SVSJOIN 0 would have the same effect...
so like katsklaw said, what i suggested earlier is the way to go.

The C code for an anope module to go over the channels a user is in would look more or less like this:
Code: [Select]

User *u;
struct u_chanlist *uc;
Channel *c;

...

/* *u needs to point to a user by now... */
for (uc = u->chans; uc; uc = uc->next) {
    if ((c = uc->chan)) {
        ...
    }
}
Logged
If you like me donate coins to 1FBmZVT4J8WAUMHKqpWhgNVj3XXnRN1cCk :)

UnDeRGoD

  • Anope User
  • Offline Offline
  • Posts: 13
(No subject)
« Reply #8 on: May 06, 2007, 04:52:27 PM »

Thank you very much, thats what i need. []
Logged
Pages: [1]   Go Up