/* :42XAAAAAB TOPIC #testchan :test test test */ int denora_event_topic(char *source, int ac, char **av) { char *newav[5]; User *u; if (denora->protocoldebug) { protocol_debug(source, ac, av); } if (ac == 2) { u = user_find(source); if (u) { newav[0] = sstrdup(av[0]); newav[1] = sstrdup(u->nick); newav[2] = itostr(time(NULL)); newav[3] = sstrdup(av[1]); do_topic(4, newav); free(newav[0]); free(newav[1]); free(newav[3]); } } else { do_topic(ac, av); } return MOD_CONT; }
int xanadu_event_topic(char *source, int ac, char **av) { if (ac != 4) return MOD_CONT; do_topic(source, ac, av); return MOD_CONT; }
int denora_event_topic(char *source, int ac, char **av) { User *u; Server *s; char *newav[5]; if (denora->protocoldebug) protocol_debug(source, ac, av); if (ac < 4) return MOD_CONT; u = user_find(source); if (!u) s = server_find(source); newav[0] = av[0]; if (u) newav[1] = u->nick; else if (s) newav[1] = s->name; else newav[1] = source; newav[2] = av[ac - 2]; newav[3] = av[ac - 1]; newav[4] = '\0'; do_topic(4, newav); return MOD_CONT; }
/* :%s TOPIC %s %s %lu :%s parv[0] = sender prefix parv[1] = channel parv[2] = topic nick parv[3] = topic time parv[4] = topic text */ int denora_event_topic(char *source, int ac, char **av) { if (denora->protocoldebug) { protocol_debug(source, ac, av); } do_topic(ac, av); return MOD_CONT; }
int denora_event_ftopic(char *source, int ac, char **av) { /* :source FTOPIC channel ts setby :topic */ char *temp; if (ac < 4) return MOD_CONT; temp = av[1]; /* temp now holds ts */ av[1] = av[2]; /* av[1] now holds set by */ av[2] = temp; /* av[2] now holds ts */ do_topic(ac, av); return MOD_CONT; }
int anope_event_tburst (char *source, int ac, char **av) { if (ac != 5) return MOD_CONT; av[0] = av[1]; av[1] = av[3]; av[3] = av[4]; do_topic (source, 4, av); return MOD_CONT; }
/* irc.dev.cccp-project.net TBURST 1218474093 #oper 1212613221 Celestin :Main L2Thorn Channel */ int denora_event_tburst(char *source, int ac, char **av) { if (denora->protocoldebug) protocol_debug(source, ac, av); if (ac != 5) return MOD_CONT; av[0] = av[1]; av[1] = av[3]; av[3] = av[4]; do_topic(4, av); return MOD_CONT; }
int anope_event_topic (char *source, int ac, char **av) { if (ac == 4) { do_topic (source, ac, av); } else { Channel *c = findchan (av[0]); time_t topic_time = time (NULL); if (!c) { if (debug) { alog ("debug: TOPIC %s for nonexistent channel %s", merge_args (ac - 1, av + 1), av[0]); } return MOD_CONT; } if (check_topiclock (c, topic_time)) return MOD_CONT; if (c->topic) { free (c->topic); c->topic = NULL; } if (ac > 1 && *av[1]) c->topic = sstrdup (av[1]); strscpy (c->topic_setter, source, sizeof (c->topic_setter)); c->topic_time = topic_time; record_topic (av[0]); if (ac > 1 && *av[1]) send_event(EVENT_TOPIC_UPDATED, 2, av[0], av[1]); else send_event(EVENT_TOPIC_UPDATED, 2, av[0], ""); } return MOD_CONT; }
int denora_event_topic(char *source, int ac, char **av) { char *newav[5]; if (denora->protocoldebug) protocol_debug(source, ac, av); if (ac < 4) return MOD_CONT; newav[0] = av[0]; newav[1] = av[1]; newav[2] = av[ac - 2]; newav[3] = av[ac - 1]; newav[4] = '\0'; do_topic(4, newav); return MOD_CONT; }
/* Normal RFC style topic: :source TOPIC chan :topic */ int denora_event_topic(char *source, int ac, char **av) { char *newav[127]; if (ac < 2) { return MOD_CONT; } newav[0] = sstrdup(av[0]); newav[1] = sstrdup(source); newav[2] = itostr(time(NULL)); newav[3] = sstrdup(av[1]); do_topic(4, newav); if (newav[0]) { free(newav[0]); } if (newav[1]) { free(newav[1]); } if (newav[3]) { free(newav[3]); } return MOD_CONT; }