int tcl_parse_jump(char *from, char *rest, Hook *hook) { Tcl_Obj *tcl_result; int i; #ifdef DEBUG debug("(tcl_parse_jump) %s %s %s\n", nullstr(hook->self),nullstr(from),nullstr(rest)); #endif /* DEBUG */ if (from) nickcpy(CurrentNick,from); else *CurrentNick = 0; Tcl_SetVar(energymech_tcl,"_from",from,0); Tcl_SetVar(energymech_tcl,"_rest",rest,0); i = 0; if (Tcl_VarEval(energymech_tcl,hook->self," $_from $_rest",NULL) == TCL_OK) { tcl_result = Tcl_GetObjResult(energymech_tcl); Tcl_GetIntFromObj(energymech_tcl,tcl_result,&i); } #ifdef DEBUG if (energymech_tcl->result && *energymech_tcl->result) debug("(tcl_parse_jump) result = %s\n",nullstr(energymech_tcl->result)); #endif /* DEBUG */ return(i); }
void do_shitlist(COMMAND_ARGS) { Shit *shit; table_buffer("\037channel\037\t\037mask\037\t\037action\037\t\037set by\037\t\037reason\037\t\037expires\037"); for(shit=current->shitlist;shit;shit=shit->next) { table_buffer(FMT_6XSTRTAB,shit->chan,shit->mask,shit_actions[shit->action], nickcpy(NULL,shit->from),shit->reason,time2away(shit->expire)); } table_send(from,2); }
void shit_action(Chan *chan, ChanUser *cu) { Shit *shit; const char *nick; char *fromnick; char *userhost; if (!chan->setting[TOG_SHIT].int_var || !chan->bot_is_op || cu->user) return; userhost = get_nuh(cu); if ((cu->shit = find_shit(userhost,chan->name)) == NULL) return; shit = cu->shit; if (shit->action == SHIT_KB || shit->action == SHIT_PERMABAN) { nick = cu->nick; send_mode(chan,85,QM_CHANUSER,'-','o',cu); send_mode(chan,90,QM_RAWMODE,'+','b',shit->mask); fromnick = nickcpy(NULL,shit->from); send_kick(chan,nick,"%s %s: %s",time2small(shit->time),fromnick, (shit->reason) ? shit->reason : "GET THE HELL OUT!!!"); return; } else /* * shitlevel 1: not allowed to be chanop */ if (shit->action == SHIT_CHANOP) { send_mode(chan,160,QM_CHANUSER,'-','o',(void*)cu); } }