Sending to nick URLs is now supported.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 7 Oct 2012 01:00:18 +0000 (21:00 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 7 Oct 2012 01:00:18 +0000 (21:00 -0400)
NEWS
irkerd
irkerd.xml

diff --git a/NEWS b/NEWS
index dbb599fcea3bee3446325df3544082da21f2d2ee..266c036365712fae3463a685fe38c1d959e3e97e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
                        irker history 
 
+1.8 @
+  It's now possible to send to nick URLs.
+
 1.7 @ 2012-10-05
   This is a stable release.
   Optional metadata filtering with a user-specified command.
diff --git a/irkerd b/irkerd
index 9aeb4ea2bbcd16fe4b998fbb9e651cb49f323f32..0dd5835da97445a62edfa332ee77a2e6017cb463 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -104,6 +104,8 @@ except ImportError:
 # DEAF and CHANLIMIT and (obsolete) MAXCHANNELS features.  CHANLIMIT
 # is as described in the Internet RFC draft
 # draft-brocklesby-irc-isupport-03 at <http://www.mirc.com/isupport.html>.
+# The ",isnick" feature is as described in
+# <http://ftp.ics.uci.edu/pub/ietf/uri/draft-mirashi-url-irc-01.txt>.
 
 class Connection:
     def __init__(self, irkerd, servername, port):
@@ -292,7 +294,10 @@ class Target():
         # got kicked, and irkerd crashed because the server returned
         # "#channel" in the notification that our kick handler saw.
         self.channel = parsed.path.lstrip('/').lower()
-        if self.channel and self.channel[0] not in "#&+":
+        isnick = self.channel.endswith(",isnick")
+        if isnick:
+            self.channel = self.channel[:-7]
+        if self.channel and not isnick and self.channel[0] not in "#&+":
             self.channel = "#" + self.channel
         self.port = int(ircport)
     def valid(self):
index ec418a0189157fffe34402a8d40ab1231307ebf2..0e5b296b47e0e139ae98fbda3c2a8fbd87134457 100644 (file)
@@ -43,9 +43,11 @@ Examples:
 {"to":"irc://chat.hypothetical.net:6668/git-ciabot", "privmsg":"Hello, world!"}
 </programlisting></para>
 
-<para>If the channel part of the URL does not have one of the prefix characters
-<quote>#</quote>, <quote>&amp;</quote>, or <quote>+</quote>, a <quote>#</quote>
-will be prepended to it before shipping.</para>
+<para>If the channel part of the URL does not have one of the prefix
+characters <quote>#</quote>, <quote>&amp;</quote>, or
+<quote>+</quote>, a <quote>#</quote> will be prepended to it before
+shipping - <emphasis>unless</emphasis>the channel part has the suffix
+",isnick" (which is unconditionally removed).</para>
 
 <para>The host part of the URL may have a port-number suffix separated by a
 colon, as shown in the third example; otherwise