예제 #1
0
파일: do_seen.c 프로젝트: Abysim/NyanLion
/* do_seennick():
 * takes a seen-dataset and produces the corresponding reply basically
 * by referencing to the lang entry with the same number as the seen-type.
 */
static char *do_seennick(seendat *l)
{
//  char buf[256], *msg;
  int stype;

  Context;
  if (!l) {
    debug0("ERROR! Tryed to do a seennick on a NULL pointer!");
    return "ERROR! seendat == NULL!!!";
  }
  glob_seendat = l;
  // l->type is the basic language-entry-number
  stype = l->type + 100;
  // in some cases, we might need a special reply, so modify the
  // number if neccessary
  switch (l->type) {
    case SEEN_JOIN:
      if (!onchan(l->nick, l->chan))
        stype += 20;
      break;
    case SEEN_PART:
      /* nothing to do here */
      break;
    case SEEN_SIGN:
      /* nothing again */
      break;
    case SEEN_NICK:
      if (!onchan(l->msg, l->chan))
        stype += 20;
      break;
    case SEEN_NCKF:
      if (!onchan(l->nick, l->chan))
        stype += 20;
      break;
    case SEEN_KICK:
/*      msg = buf;
      strncpy(buf, l->msg, 255);
      msg[255] = 0;
      sglobpunisher = newsplit(&msg);
      sglobreason = msg; */
      break;
    case SEEN_SPLT:
      /* nothing to do here */
      break;
    case SEEN_REJN:
      if (!onchan(l->nick, l->chan))
        stype += 20;
      break;
    case SEEN_CHJN:
    case SEEN_CHPT:
      if (!strcmp(l->chan, "0"))
        stype += 20;
      break;
    default:
      stype = 140;
  }
  return getslang(stype);
}
예제 #2
0
/* <?slang #?>
 * outputs a line from the slangfile
 */
static void template_send_slang(int idx, struct template_content *tpc)
{
  dprintf(idx, "%s", getslang(tpc->intpar1));
}