/[svn]/hopm/branches/1.1.x/src/irc.c
ViewVC logotype

Diff of /hopm/branches/1.1.x/src/irc.c

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

revision 8124 by michael, Mon Apr 3 16:39:28 2017 UTC revision 8125 by michael, Mon Apr 3 16:57:23 2017 UTC
# Line 224  static void Line 224  static void
224  m_privmsg(char *parv[], unsigned int parc, const char *msg, const char *source_p)  m_privmsg(char *parv[], unsigned int parc, const char *msg, const char *source_p)
225  {  {
226    const struct ChannelConf *channel = NULL;    const struct ChannelConf *channel = NULL;
   size_t nick_len;  
227    
228    if (source_p == NULL)    if (source_p == NULL)
229      return;      return;
# Line 247  m_privmsg(char *parv[], unsigned int par Line 246  m_privmsg(char *parv[], unsigned int par
246    if ((channel = get_channel(parv[2])) == NULL)    if ((channel = get_channel(parv[2])) == NULL)
247      return;      return;
248    
249    /* Find a suitable length to compare with */    int hit = strncasecmp(parv[3], "!all ", 5) == 0;
250    nick_len = strcspn(parv[3], " :,");    if (hit == 0)
251      {
252        size_t nick_len = strlen(IRCItem->nick);
253    
254    if (nick_len < 3 && strlen(IRCItem->nick) >= 3)      if (strncasecmp(parv[3], IRCItem->nick, nick_len) == 0)
255      nick_len = 3;        hit = *(parv[3] + nick_len) == ' ';
256      }
257    
258    /* Message is a command */    if (hit)
   if (strncasecmp(parv[3], IRCItem->nick, nick_len) == 0 ||  
       strncasecmp(parv[3], "!all", 4) == 0)  
   {  
259      /* XXX command_parse will alter parv[3]. */      /* XXX command_parse will alter parv[3]. */
260      command_parse(parv[3], channel, source_p);      command_parse(parv[3], channel, source_p);
   }  
261  }  }
262    
263  /* m_notice  /* m_notice

Legend:
Removed from v.8124  
changed lines
  Added in v.8125

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