示例#1
0
文件: LINK.C 项目: jeske/GTalk
/* ddial link Commands */
void ddial_p(char *str,char *name,int portnum)
{
   char *point;
   char private[STRING_SIZE+30];
   int user;
   int temp=*(str+1);

   if ((temp<'0') || (temp>'9'))
     {
          user=*str-'0';
          str++;
     }
      else
      {
      user=((10* (*str-'0'))+(temp-'0'));
      str++; str++;
      }



   if (user>sys_info.max_nodes)
     {
        return;
    }
   if (!abuf_status[user].active)
     {
        return;
     }
   if (squelched(portnum,user) && !line_status[user].lurking)
     {
        /* calc return path and send --> squelched */
        return;
     }

   if (line_status[user].lurking && (!squelched(portnum,user) &&
                    !test_bit(user_options[tswitch].privs,LURK_PRV)))
    {
      return;
    }
   /* THIS IS SO YOU CANNOT /p YOURSELF */
   if (user==tswitch)
      return;
   point=str;

   if (line_status[user].link)
   {


    if (*point==32)
      {
        sprintf(private,"/PS %02d%s",portnum,point+1);
        aput_into_buffer(user,private,0,14,portnum,user,0);
        return;
      }
      else
      if (*point=='/')  /*it's a command*/
示例#2
0
static void cmd_room_typing2 (char *room)
{
  int r;
  SLOT_LIST *sl;
  SLOT *sp;
  int nobody = 1;

  if (room[0]) {
    r = atoi (room);
    if (r < 1 || r > 99) {
      writestr (cur_slot, "Incorrect room number.\n");
      setproc (sendpub, MAXMSG, 0);
      return;
    }
  } else
    r = cur_slot->acct.chan;

  if (r != cur_slot->acct.chan &&
      !channels[r].name &&
      cur_slot->acct.level != TOPLEVEL) {
    writestr (cur_slot, "Sorry, you cannot look into that room.\n");
    setproc (sendpub, MAXMSG, 0);
    return;
  }

  for (sl = channels[r].members; sl; sl = sl->next) {
    sp = sl->slot;
    if (sp == cur_slot || !sp->flags.stopped)
      continue;
    if ((squelched (cur_slot, sp) || reversed (sp, cur_slot)) &&
        cur_slot->acct.level != TOPLEVEL)
      continue;
    if (nobody) {
      if (channels[r].name)
        sprintf (msg_buf,
                 "Users currently typing in room %02d (%s):\n",
                 r, channels[r].name);
      else
        sprintf (msg_buf,
                 "Users currently typing in room %02d (unnamed):\n", r);
      writestr (cur_slot, msg_buf);
      nobody = 0;
    }
    print_typing (sp);
  }

  if (nobody) {
    if (channels[r].name)
      sprintf (msg_buf, "Nobody is typing in room %02d (%s).\n",
               r, channels[r].name);
    else
      sprintf (msg_buf, "Nobody is typing in room %02d (unnamed).\n", r);
    writestr (cur_slot, msg_buf);
  }

  setproc (sendpub, MAXMSG, 0);
}
示例#3
0
static void cmd_beep2 (SLOT *dst_slot, char *id)
{
  char beep_code[] = "\a";

  if (!squelched (dst_slot, cur_slot) && !reversed (cur_slot, dst_slot)) {
    sprintf (msg_buf, " * You are being *beeped* by %s/%s",
             cur_slot->acct.id, cur_slot->acct.handle);
    if (dst_slot->acct.beeping) {
      writestr (dst_slot, beep_code);
    } else
      strcat (msg_buf, "\n * BEEEEEEEEEEEEEEEEP!!!");
    writeaction (dst_slot, msg_buf);
  }
  writestr (cur_slot, "Beep sent.\n");
  setproc (sendpub, MAXMSG, 0);
}
示例#4
0
void cmd_typing (void)
{
  SLOT *sp;
  int i;
  int nobody = 1;

  for (i = 0; i <= slots_used; i++) {
    sp = slotbase[i];
    if (!sp || sp == cur_slot || !sp->flags.on || !sp->flags.stopped)
      continue;
    if ((squelched (cur_slot, sp) || reversed (sp, cur_slot)) &&
        cur_slot->acct.level != TOPLEVEL)
      continue;
    if (nobody) {
      writestr (cur_slot, "Users currently typing:\n");
      nobody = 0;
    }
    print_typing (sp);
  }
  if (nobody)
    writestr (cur_slot, "Nobody is currently typing.\n");
}
示例#5
0
void dump_userinfo (SLOT *sp)
{
  ACCOUNT *acct;
  SLOT *sq;
  int i;

  acct = &sp->acct;

  dump_userinfoshort (acct, 1);

  writestr (cur_slot, "Account created from: ");
  writestr (cur_slot, acct->created_from);
  writestr (cur_slot, "\nMessage format: ");
  writestr (cur_slot, acct->msgfmt);
  writestr (cur_slot, "\nActive format: ");
  writestr (cur_slot, acct->activefmt);
  writestr (cur_slot, "\nNewline character: ");
  writech (cur_slot, acct->nlchar);
  writestr (cur_slot, "\nNewlines ");
  writestr (cur_slot, acct->newlines ? "on" : "off");
  writestr (cur_slot, "\nBeeping ");
  writestr (cur_slot, acct->beeping ? "on" : "off");
#ifndef NOBROADCAST
  writestr (cur_slot, "\nBroadcast messages ");
  writestr (cur_slot, acct->nostat ? "off" : "on");
#endif
  writestr (cur_slot, "\nPA messages ");
  writestr (cur_slot, acct->pa_notify ? "off" : "on");
  writestr (cur_slot, "\nANSI colors ");
  writestr (cur_slot, acct->usecolor ? "on" : "off");
  writestr (cur_slot, "\nEmail status: ");
  writestr (cur_slot, acct->email_verified ? "verified" : "new");

  writestr (cur_slot, "\nUser has squelched:");
  for (i = 1; i <= slots_used; i++) {
    sq = slotbase[i];
    if (sq && squelched (sp, sq)) {
      writestr (cur_slot, " ");
      writestr (cur_slot, sq->acct.id);
    }
  }
  writestr (cur_slot, "\nUser has reversed:");
  for (i = 1; i <= slots_used; i++) {
    sq = slotbase[i];
    if (sq && reversed (sp, sq)) {
      writestr (cur_slot, " ");
      writestr (cur_slot, sq->acct.id);
    }
  }
  writestr (cur_slot, "\nUser is being squelched by:");
  for (i = 1; i <= slots_used; i++) {
    sq = slotbase[i];
    if (sq && squelched (sq, sp)) {
      writestr (cur_slot, " ");
      writestr (cur_slot, sq->acct.id);
    }
  }
  writestr (cur_slot, "\nUser is being reversed by:");
  for (i = 1; i <= slots_used; i++) {
    sq = slotbase[i];
    if (sq && reversed (sq, sp)) {
      writestr (cur_slot, " ");
      writestr (cur_slot, sq->acct.id);
    }
  }
  writech (cur_slot, '\n');
}