ekg2  GIT master
Funkcje
Dokumentacja pliku autoacts.c
#include "ekg2.h"
#include "irc.h"
#include "autoacts.h"
Wykres zależności załączania dla autoacts.c:

Funkcje

static gint irc_autorejoin_timer (gint type, gpointer data)
 
int irc_onkick_handler (void *data, va_list ap)
 
int irc_autorejoin (session_t *s, int when, char *chan)
 

Dokumentacja funkcji

◆ irc_autorejoin()

int irc_autorejoin ( session_t s,
int  when,
char *  chan 
)

irc_autorejoin()

Try to rejoin.

Do zrobienia:
We double check "REJOIN" if IRC_REJOIN_KICK
Parametry
s- session
when- type of rejoining:
  • IRC_REJOIN_CONNECT When we want to rejoin to all channels we had opened for example after /reconnect
  • IRC_REJOIN_KICK When we want to rejoin to given channel (chan)
chan- if when == IRC_REJOIN_KICK than it specify to which channel we want to rejoin after kick.
Zwraca
0 - if we send JOIN commands to ircd...
-1 - If smth went wrong.

◆ irc_autorejoin_timer()

static gint irc_autorejoin_timer ( gint  type,
gpointer  data 
)
static

irc_autorejoin_timer()

Timer handler for auto-rejoining
Added by irc_autorejoin() It just execute irc_autorejoin() with params...

Do zrobienia:

Remove some struct info from irc_onkick_handler_t? Here we use only channelname and session..

Check session with session_find_ptr() ?

Parametry
data- irc_onkick_handler_t * struct with data inited by irc_autorejoin()
Zwraca
-1 [TEMPORARY HANDLER]

◆ irc_onkick_handler()

int irc_onkick_handler ( void *  data,
va_list  ap 
)

irc_onkick_handler()

Handler for: IRC_KICK

Here we check if we were kicked (by checking nick) and if yes, than if we want to rejoin on kick (REJOIN && REJOIN_TIME)
Than after time specified by REJOIN_TIME we try to rejoin

Zobacz również
irc_autorejoin() - for rejoin function
irc_autorejoin_timer() - for rejoin timer.
Do zrobienia:
We don't check if nick and chan is full uid.. It's I think correct.. However can be faulty.
Parametry
ap1st param: (char *) session - session uid ap 2nd param: (char *) nick - full uid of kicked person (irc:nickname) ap 3rd param: (char *) chan - full uid of channel where kick event happen. ap 4th param: (char *) kickedby - full uid who kicked.
dataNULL
Zwraca
1 - If no session, no irc session, or no private struct.
2 - If we are not interested in autorejoining [either smb else was kicked (not us) or REJOIN was not set]
3 - If we'll try to autorejoin