patchWeeChat - Patches: patch #7133, add irc_is_nick info for check if...

 
 

patch #7133: add irc_is_nick info for check if a given string is a valid nick

Submitted by:  Elián Hanisch <m4v>
Submitted on:  Wed 24 Mar 2010 08:20:24 PM UTC  
 
Category:  irc plugin Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  Sebastien Helleu <flashcode> Open/Closed:  Closed
IRC nick:  m4v

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 24 Mar 2010 08:28:49 PM UTC, comment #1:

ah, looks like my patch has a bug, since a "" string will return 1

the if (!string) condition should be if (!string || !string[0])

Elián Hanisch <m4v>
Wed 24 Mar 2010 08:20:24 PM UTC, original submission:

IRC nicks can only use "a-zA-Z0-9[]\`_^{|}-" chars and can't start with a hyphen or number.
Recently I had to write a regexp in one of my scripts for check this, I figured it would be useful to have it available for any script as an info

in python:

weechat.get_info('irc_is_nick', 'm4v') -> 1
weechat.get_info('irc_is_nick', '#m4v') -> ""

Elián Hanisch <m4v>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #20026:  irc_is_nick.patch added by m4v (3KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by flashcode (Updated the item)
  • -email is unavailable- added by m4v (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-03-02 flashcode Open/ClosedOpen => Closed
    2010-03-28 flashcode StatusNone => Done
        Assigned toNone => flashcode
    2010-03-24 m4v Attached File- => Added irc_is_nick.patch, #20026

    Back to the top


    Powered by Savane 3.3