Beispiel #1
0
Channel::Channel(QNetworkAccessManager *n, QList<QNetworkCookie> cookies, QString ppath, QString pclid, QString pec, QString pprop, User pms, ConversationModel *cModel, RosterModel *rModel)
{
    LPrep = NULL;
    channelError = false;
    lastIncomingConvId = "";

    nam = n;
    myself = pms;
    conversationModel = cModel;
    rosterModel = rModel;

    session_cookies = cookies;
    path = ppath;
    clid = pclid;
    ec = pec;
    prop = pprop;

    //Init
    lastPushReceived = QDateTime::currentDateTime();

    QTimer *timer = new QTimer(this);
    QObject::connect(timer, SIGNAL(timeout()), this, SLOT(checkChannel()));
    timer->start(30000);
}
Beispiel #2
0
void thread3 ( void ) {

	checkChannel(CHAN3);
}
Beispiel #3
0
void thread2 ( void ) {
	
	checkChannel(CHAN2);
}
Beispiel #4
0
void thread1 ( void ) {

	checkChannel(CHAN1);	
}
Beispiel #5
0
/*
 * Syntax: CHECK <channel|nick|server|hostmask> [-flags]
 * 
 * Where valid flags are:
 * -c: Show channels when checking a hostmask.
 * -i: Show IPs instead of hostnames when displaying results.
 * -o: Only show channel operators when checking a channel.
 * -u: Hide users when checking a channel.
 * 
 * <hostmask> can be of the form host, user@host, nick!user@host, 
 * with host being host.domain.cc, 127.0.0.1 or 127.0.0.0/24.
 * Wildcards are supported.
 */
int mo_check(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
{
   struct Channel *chptr;
   struct Client *acptr;
   int flags = CHECK_SHOWUSERS, i;


   if (!HasPriv(sptr, PRIV_CHECK))
     return send_reply(sptr, ERR_DISABLED, "CHECK");

   if (parc < 2) {
      send_reply(sptr, ERR_NEEDMOREPARAMS, "CHECK");
      return 0;
   }

   if ( parc>=4 || (parc==3 && parv[2][0] != '-')) {
    /* remote query */
    if (hunt_server_cmd(sptr, CMD_CHECK, cptr, 0, parc==4 ? "%C %s %s" : "%C %s", 1, parc, parv) != HUNTED_ISME)
       return 0;
     parv++; parc--;
   }

   /* This checks to see if any flags have been supplied */
   if ((parc >= 3) && (parv[2][0] == '-')) {
    for (i = 0; parv[2][i]; i++) {
        switch (parv[2][i]) {
       case 'c':
         flags |= CHECK_CHECKCHAN;
         break;
        
       case 'o':
         flags |= CHECK_OPSONLY; /* fall through */
       case 'u':
         flags &= ~(CHECK_SHOWUSERS);
         break;
        
       case 'i':
         flags |= CHECK_SHOWIPS;
         break;
        
       default:
         /* might want to raise some sort of error here? */
         break;
       }
     }
   }

   if (IsChannelName(parv[1]))  /* channel */
   {
      if ((chptr = FindChannel(parv[1])))
      {
         checkChannel(sptr, chptr);
         checkUsers(sptr, chptr, flags);
      }
      else
      {
         send_reply(sptr, ERR_SEARCHNOMATCH, "CHECK", parv[1]);
      }
   }
   else if ((acptr = FindClient(parv[1])) && !(FindServer(parv[1])))  /* client and not a server */
   {
      if (!IsRegistered(acptr))
   	{
         send_reply(sptr, ERR_SEARCHNOMATCH, "CHECK", parv[1]);
         return 0;
      }

    checkClient(sptr, acptr);
   }
   else if ((acptr = FindServer(parv[1]))) { /* server */
     checkServer(sptr, acptr);
   }
   else if (checkHostmask(sptr, parv[1], flags) > 0) /* hostmask */
     return 1;
   else /* no match */
     send_reply(sptr, ERR_SEARCHNOMATCH, "CHECK", parv[1]);

 
  return 1;
}