examples/mcabberrc.lua
changeset 99 ed4676536ed9
parent 84 c0db7efde255
child 106 c60fe499f075
--- a/examples/mcabberrc.lua	Wed Mar 31 00:28:04 2010 +0300
+++ b/examples/mcabberrc.lua	Wed Mar 31 01:25:19 2010 +0300
@@ -56,6 +56,7 @@
 - del_completion - removes word from completions
 - command        - adds/removes mcabber command
 - option         - sets/gets mcabber option
+- hook           - creates hook handler object
 
 STRUCTURE
 
@@ -181,90 +182,36 @@
 		end
 	end )
 
--- commands to allow leading smileys
-for k, arg in ipairs ( { ')', '/', '(', 'D', '-/', 'S', '1', ']', '[' } ) do
-	main.command ( arg,
-		function ( args )
-			main.run ( 'say :' .. arg .. ' ' .. args )
-		end )
-end
-
--- HOOKS
-
-hooks_d = {
-	['hook-message-in']       = { },
-	['hook-message-out']      = { },
-	['hook-status-change']    = { },
-	['hook-my-status-change'] = { },
-	['hook-post-connect']     = { },
-	['hook-pre-disconnect']   = { },
-	['hook-start']            = { },
-	['hook-quit']             = { },
-}
+-- SAVING URLS TO FILE
+-- These are implemented in C in urlopen and openurl modules
 
--- hook:
--- - hook-message-in
---   jid
---   groupchat
---   message
--- - hook-message-out
---   jid
---   message
--- - hook-status-change
---   jid
---   resource
---   new_status
---   old_status
---   message
--- - hook-my-status-change
---   new_status
---   message
--- - hook-post-connect
--- - hook-pre-disconnect
--- - hook-start
--- - hook-quit
-function hook_handler ( args )
-	if [hooks_d[args.hook] then
-		for mod, cb in pairs ( hooks_d[args.hook] ) do
-			if cb then
-				cb ( args )
-			end
-		end
-	end
-end
-
--- FIXME
-
-hooks_d['hook-post-connect'].fifoperms =
-	function ( args )
-		-- TODO: posix
-		os.execute ( 'chmod 0666 ' .. main.option ( 'fifo_name' ) )
-		hooks_d['hook-post-connect'].fifoperms = nil
-	end
-
--- SAVING URLS TO FILE
-
-require 'urls'
+-- require 'urls'
 
 -- TRANSPORTED BUDDIES AVAILABILITY INDICATION
+-- After all, I do not use this anymore :/
+-- But you can try.
 
-require 'transports'
+-- require 'transports'
 
 -- BEEPING ON ALL MESSAGES
+-- Implemented in C by in-tree beep module
 
-require 'beep'
+-- require 'beep'
 
 -- MARKING
+-- Implemented in C in marking module
 
-require 'marking'
+-- require 'marking'
 
 -- JOBS
+-- Somewhat error-prone, requires jobs file existance, never seriously used by me :(
 
-require 'jobs'
+-- require 'jobs'
 
 -- ROOM NICK COMPLETION
+-- Well, it's sorta hacky, but I do use it
 
-require 'room_priv'
+-- require 'room_priv'
 
 -- FORMS
 
@@ -285,8 +232,9 @@
 require 'muc'
 
 -- IN-BAND BYTESTREAMS (XEP-0047)
+-- Implemented in C in streams module
 
-require 'ibb'
+-- require 'ibb'
 
 -- VCARD-TEMP (XEP-0054)
 
@@ -301,42 +249,50 @@
 require 'oob'
 
 -- MALICIOUS STANZAS (XEP-0076)
+-- Well, that's joke XEP and joke module
 
-require 'evil'
+-- require 'evil'
 
 -- IN-BAND REGISTRATION (XEP-0077)
 
 require 'register'
 
 -- USER LOCATION (XEP-0080)
+-- Implemented in C in geoloc module
 
-require 'geoloc'
+-- require 'geoloc'
 
 -- USER AVATAR (XEP-0084)
+-- Implemented in C in avatar module
 
-require 'avatar'
+-- require 'avatar'
 
 -- USER MOOD (XEP-0107)
+-- Implemented in C in mood module
 
-require 'mood'
+-- require 'mood'
 
 -- USER ACTIVITY (XEP-0108)
+-- Implemented in C in activity module
 
-require 'activity'
+-- require 'activity'
 
 -- USER TUNE (XEP-0118)
+-- Implemented in C in tune module
 
-require 'tune'
+-- require 'tune'
 
 -- REMOTE CONTROLLING CLIENTS (XEP-0146)
 
 require 'remote'
 
 -- PERSONAL EVENTING PROTOCOL (XEP-0163)
+-- Implemented in C in pep module
 
 -- XMPP PING (XEP-0199)
+-- Included into upstream as /request ping
 
-require 'ping'
+-- require 'ping'
 
 -- ATTENTION (XEP-0224)