Author: nornagon
Date: 2005-07-06 20:17:12 -0400 (Wed, 06 Jul 2005)
New Revision: 849

Modified:
   trunk/clients/ravish/ravish2.rb
Log:
PART and some other little fixes

Modified: trunk/clients/ravish/ravish2.rb
===================================================================
--- trunk/clients/ravish/ravish2.rb     2005-07-06 23:57:57 UTC (rev 848)
+++ trunk/clients/ravish/ravish2.rb     2005-07-07 00:17:12 UTC (rev 849)
@@ -199,7 +199,7 @@
                                else
                                        "%(lowact)#{a[0] + 1}"
                                end
-                       }.join("%(statdecs),%(status) ") +
+                       }.join("%(statdecs),%(status)") +
                        "%(statdecs)]%(status)"
                end
                win.window.status = status
@@ -246,6 +246,23 @@
                end
        end
 
+       def ev_PART cid, uid
+               win = find_window :channel, cid
+               if @nick and uid == @nick
+                       if win
+                               @windows.delete win
+                               @term.delete_window win.window
+                       else
+                               srvmsg "Stray PART: #{uid} parts #{cid}"
+                       end
+               elsif win
+                       win.window.print "#{uid} has left #{cid}"
+                       activity win, 1
+               else
+                       srvmsg "Stray PART: #{uid} parts #{cid}"
+               end
+       end
+
        def ev_LIST cid, ns, *users
                if ns == 'user'
                        listed = 'Users'
@@ -278,7 +295,7 @@
                end
        end
 
-       ## CLIENT COMMANDS ##
+       ## USER COMMANDS ##
 
        def unknown_user_cmd cmd, args
                srvmsg "Unknown command: #{cmd}"
@@ -325,6 +342,14 @@
                @haver.msg 'JOIN', args[0]
        end
 
+       def user_PART args
+               if args[0]
+                       @haver.msg 'PART', args[0]
+               elsif win = find_window(@term.current_window) and win.type == 
:channel
+                       @haver.msg 'PART', win['channel']
+               end
+       end
+
        def user_NAMES args
                if args[0] and args[1]
                        @haver.msg 'LIST', args[0], args[1]
@@ -334,6 +359,7 @@
                        @haver.msg 'LIST', win['channel'], 'user'
                end
        end
+       alias_method :user_LIST, :user_NAMES
 end
 
 ravish = Ravish.new 'hardison.net'


Reply via email to