/[svn]/ircd-hybrid-8/modules/m_away.c
ViewVC logotype

Diff of /ircd-hybrid-8/modules/m_away.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1448 by michael, Sun Mar 25 11:24:18 2012 UTC revision 1449 by michael, Tue Jun 26 18:17:03 2012 UTC
# Line 72  m_away(struct Client *client_p, struct C Line 72  m_away(struct Client *client_p, struct C
72      return;      return;
73    }    }
74    
   /* Marking as away */  
   if ((CurrentTime - source_p->localClient->last_away) < ConfigFileEntry.pace_wait)  
   {  
     sendto_one(source_p, form_str(RPL_LOAD2HI),  
                me.name, source_p->name);  
     return;  
   }  
   
   source_p->localClient->last_away = CurrentTime;  
75    new_away_msg = parv[1];    new_away_msg = parv[1];
   
76    nbytes = strlen(new_away_msg);    nbytes = strlen(new_away_msg);
   if (nbytes > (size_t)AWAYLEN) {  
     new_away_msg[AWAYLEN] = '\0';  
     nbytes = AWAYLEN;  
   }  
   
   /* we now send this only if they  
    * weren't away already --is */  
   if (!cur_away_msg)  
   {  
     sendto_server(client_p, NULL, CAP_TS6, NOCAPS,  
                   ":%s AWAY :%s", ID(source_p), new_away_msg);  
     sendto_server(client_p, NULL, NOCAPS, CAP_TS6,  
                   ":%s AWAY :%s", source_p->name, new_away_msg);  
   }  
   else  
     MyFree(cur_away_msg);  
   
   cur_away_msg = MyMalloc(nbytes + 1);  
   strcpy(cur_away_msg, new_away_msg);  
   source_p->away = cur_away_msg;  
   
   sendto_one(source_p, form_str(RPL_NOWAWAY), me.name, source_p->name);  
 }  
77    
 static void  
 mo_away(struct Client *client_p, struct Client *source_p,  
         int parc, char *parv[])  
 {  
   char *cur_away_msg = source_p->away;  
   char *new_away_msg = NULL;  
   size_t nbytes = 0;  
   
   if (!IsFloodDone(source_p))  
     flood_endgrace(source_p);  
   
   if (parc < 2 || EmptyString(parv[1]))  
   {  
     /* Marking as not away */  
     if (cur_away_msg)  
     {  
       /* we now send this only if they were away before --is */  
       sendto_server(client_p, NULL, CAP_TS6, NOCAPS,  
                     ":%s AWAY", ID(source_p));  
       sendto_server(client_p, NULL, NOCAPS, CAP_TS6,  
                     ":%s AWAY", source_p->name);  
   
       MyFree(cur_away_msg);  
       source_p->away = NULL;  
     }  
   
     sendto_one(source_p, form_str(RPL_UNAWAY),  
                me.name, source_p->name);  
     return;  
   }  
   
   new_away_msg = parv[1];  
   
   nbytes = strlen(new_away_msg);  
78    if (nbytes > (size_t)AWAYLEN) {    if (nbytes > (size_t)AWAYLEN) {
79      new_away_msg[AWAYLEN] = '\0';      new_away_msg[AWAYLEN] = '\0';
80      nbytes = AWAYLEN;      nbytes = AWAYLEN;
# Line 224  ms_away(struct Client *client_p, struct Line 157  ms_away(struct Client *client_p, struct
157    
158  static struct Message away_msgtab = {  static struct Message away_msgtab = {
159    "AWAY", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,    "AWAY", 0, 0, 0, MAXPARA, MFLG_SLOW, 0,
160    {m_unregistered, m_away, ms_away, m_ignore, mo_away, m_ignore}    { m_unregistered, m_away, ms_away, m_ignore, m_away, m_ignore }
161  };  };
162    
163  static void  static void

Legend:
Removed from v.1448  
changed lines
  Added in v.1449

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28