spox-mod_spox 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. data/CHANGELOG +174 -0
  2. data/INSTALL +15 -0
  3. data/LICENSE +674 -0
  4. data/README.rdoc +73 -0
  5. data/bin/mod_spox +112 -0
  6. data/data/mod_spox/extras/AOLSpeak.rb +257 -0
  7. data/data/mod_spox/extras/AutoKick.rb +152 -0
  8. data/data/mod_spox/extras/AutoMode.rb +122 -0
  9. data/data/mod_spox/extras/AutoRejoin.rb +37 -0
  10. data/data/mod_spox/extras/Bash.rb +55 -0
  11. data/data/mod_spox/extras/Bouncer.rb +220 -0
  12. data/data/mod_spox/extras/Bullshit.rb +19 -0
  13. data/data/mod_spox/extras/Bytes.rb +11 -0
  14. data/data/mod_spox/extras/Confess.rb +244 -0
  15. data/data/mod_spox/extras/DCC.rb +182 -0
  16. data/data/mod_spox/extras/DevWatch.rb +153 -0
  17. data/data/mod_spox/extras/DownForEveryoneOrJustMe.rb +47 -0
  18. data/data/mod_spox/extras/EightBall.rb +33 -0
  19. data/data/mod_spox/extras/FML.rb +35 -0
  20. data/data/mod_spox/extras/FloodKicker.rb +129 -0
  21. data/data/mod_spox/extras/Fortune.rb +76 -0
  22. data/data/mod_spox/extras/GoogleIt.rb +13 -0
  23. data/data/mod_spox/extras/Headers.rb +59 -0
  24. data/data/mod_spox/extras/Karma.rb +302 -0
  25. data/data/mod_spox/extras/Locator.rb +44 -0
  26. data/data/mod_spox/extras/Logger.rb +182 -0
  27. data/data/mod_spox/extras/LolSpeak.rb +21 -0
  28. data/data/mod_spox/extras/NickServ.rb +84 -0
  29. data/data/mod_spox/extras/PhpCli.rb +308 -0
  30. data/data/mod_spox/extras/PhpFuncLookup.rb +297 -0
  31. data/data/mod_spox/extras/Pinger.rb +11 -0
  32. data/data/mod_spox/extras/Quotes.rb +79 -0
  33. data/data/mod_spox/extras/RegexTracker.rb +158 -0
  34. data/data/mod_spox/extras/Roulette.rb +267 -0
  35. data/data/mod_spox/extras/RubyCli.rb +93 -0
  36. data/data/mod_spox/extras/Search.rb +49 -0
  37. data/data/mod_spox/extras/Seen.rb +150 -0
  38. data/data/mod_spox/extras/Slashdot.rb +35 -0
  39. data/data/mod_spox/extras/SlashdotHeadlineGenerator.rb +500 -0
  40. data/data/mod_spox/extras/Talk.rb +32 -0
  41. data/data/mod_spox/extras/Topten.rb +103 -0
  42. data/data/mod_spox/extras/TracTicket.rb +66 -0
  43. data/data/mod_spox/extras/Translate.rb +132 -0
  44. data/data/mod_spox/extras/Twitter.rb +458 -0
  45. data/data/mod_spox/extras/UrbanDictionary.rb +55 -0
  46. data/data/mod_spox/extras/Weather.rb +55 -0
  47. data/data/mod_spox/plugins/Authenticator.rb +289 -0
  48. data/data/mod_spox/plugins/Banner.rb +585 -0
  49. data/data/mod_spox/plugins/BotNick.rb +18 -0
  50. data/data/mod_spox/plugins/Helper.rb +49 -0
  51. data/data/mod_spox/plugins/Initializer.rb +35 -0
  52. data/data/mod_spox/plugins/Joiner.rb +23 -0
  53. data/data/mod_spox/plugins/Nicker.rb +14 -0
  54. data/data/mod_spox/plugins/Parter.rb +23 -0
  55. data/data/mod_spox/plugins/Permissions.rb +60 -0
  56. data/data/mod_spox/plugins/PluginLoader.rb +180 -0
  57. data/data/mod_spox/plugins/Ponger.rb +70 -0
  58. data/data/mod_spox/plugins/PoolConfig.rb +52 -0
  59. data/data/mod_spox/plugins/Quitter.rb +15 -0
  60. data/data/mod_spox/plugins/Servers.rb +57 -0
  61. data/data/mod_spox/plugins/Status.rb +31 -0
  62. data/data/mod_spox/plugins/Triggers.rb +85 -0
  63. data/lib/mod_spox/BaseConfig.rb +51 -0
  64. data/lib/mod_spox/Bot.rb +604 -0
  65. data/lib/mod_spox/BotConfig.rb +65 -0
  66. data/lib/mod_spox/ConfigurationWizard.rb +180 -0
  67. data/lib/mod_spox/Database.rb +51 -0
  68. data/lib/mod_spox/Exceptions.rb +84 -0
  69. data/lib/mod_spox/Helpers.rb +122 -0
  70. data/lib/mod_spox/Loader.rb +60 -0
  71. data/lib/mod_spox/Logger.rb +37 -0
  72. data/lib/mod_spox/MessageFactory.rb +112 -0
  73. data/lib/mod_spox/Pipeline.rb +207 -0
  74. data/lib/mod_spox/Plugin.rb +97 -0
  75. data/lib/mod_spox/PluginHolder.rb +22 -0
  76. data/lib/mod_spox/PluginManager.rb +257 -0
  77. data/lib/mod_spox/PriorityQueue.rb +69 -0
  78. data/lib/mod_spox/Socket.rb +201 -0
  79. data/lib/mod_spox/Sockets.rb +226 -0
  80. data/lib/mod_spox/Timer.rb +60 -0
  81. data/lib/mod_spox/Version.rb +14 -0
  82. data/lib/mod_spox/handlers/BadNick.rb +19 -0
  83. data/lib/mod_spox/handlers/Bounce.rb +24 -0
  84. data/lib/mod_spox/handlers/Created.rb +27 -0
  85. data/lib/mod_spox/handlers/Handler.rb +39 -0
  86. data/lib/mod_spox/handlers/Invite.rb +28 -0
  87. data/lib/mod_spox/handlers/Join.rb +38 -0
  88. data/lib/mod_spox/handlers/Kick.rb +36 -0
  89. data/lib/mod_spox/handlers/LuserChannels.rb +19 -0
  90. data/lib/mod_spox/handlers/LuserClient.rb +18 -0
  91. data/lib/mod_spox/handlers/LuserMe.rb +16 -0
  92. data/lib/mod_spox/handlers/LuserOp.rb +19 -0
  93. data/lib/mod_spox/handlers/LuserUnknown.rb +19 -0
  94. data/lib/mod_spox/handlers/Mode.rb +62 -0
  95. data/lib/mod_spox/handlers/Motd.rb +38 -0
  96. data/lib/mod_spox/handlers/MyInfo.rb +24 -0
  97. data/lib/mod_spox/handlers/Names.rb +86 -0
  98. data/lib/mod_spox/handlers/Nick.rb +50 -0
  99. data/lib/mod_spox/handlers/NickInUse.rb +19 -0
  100. data/lib/mod_spox/handlers/Notice.rb +35 -0
  101. data/lib/mod_spox/handlers/Part.rb +39 -0
  102. data/lib/mod_spox/handlers/Ping.rb +25 -0
  103. data/lib/mod_spox/handlers/Pong.rb +23 -0
  104. data/lib/mod_spox/handlers/Privmsg.rb +39 -0
  105. data/lib/mod_spox/handlers/Quit.rb +29 -0
  106. data/lib/mod_spox/handlers/Topic.rb +38 -0
  107. data/lib/mod_spox/handlers/Welcome.rb +30 -0
  108. data/lib/mod_spox/handlers/Who.rb +83 -0
  109. data/lib/mod_spox/handlers/Whois.rb +117 -0
  110. data/lib/mod_spox/handlers/YourHost.rb +20 -0
  111. data/lib/mod_spox/messages/Messages.rb +6 -0
  112. data/lib/mod_spox/messages/incoming/BadNick.rb +16 -0
  113. data/lib/mod_spox/messages/incoming/Bounce.rb +18 -0
  114. data/lib/mod_spox/messages/incoming/Created.rb +15 -0
  115. data/lib/mod_spox/messages/incoming/Invite.rb +21 -0
  116. data/lib/mod_spox/messages/incoming/Join.rb +19 -0
  117. data/lib/mod_spox/messages/incoming/Kick.rb +26 -0
  118. data/lib/mod_spox/messages/incoming/LuserChannels.rb +15 -0
  119. data/lib/mod_spox/messages/incoming/LuserClient.rb +24 -0
  120. data/lib/mod_spox/messages/incoming/LuserMe.rb +18 -0
  121. data/lib/mod_spox/messages/incoming/LuserOp.rb +15 -0
  122. data/lib/mod_spox/messages/incoming/LuserUnknown.rb +15 -0
  123. data/lib/mod_spox/messages/incoming/Message.rb +22 -0
  124. data/lib/mod_spox/messages/incoming/Mode.rb +42 -0
  125. data/lib/mod_spox/messages/incoming/Motd.rb +18 -0
  126. data/lib/mod_spox/messages/incoming/MyInfo.rb +24 -0
  127. data/lib/mod_spox/messages/incoming/Names.rb +24 -0
  128. data/lib/mod_spox/messages/incoming/Nick.rb +26 -0
  129. data/lib/mod_spox/messages/incoming/NickInUse.rb +15 -0
  130. data/lib/mod_spox/messages/incoming/Notice.rb +9 -0
  131. data/lib/mod_spox/messages/incoming/Part.rb +21 -0
  132. data/lib/mod_spox/messages/incoming/Ping.rb +18 -0
  133. data/lib/mod_spox/messages/incoming/Pong.rb +9 -0
  134. data/lib/mod_spox/messages/incoming/Privmsg.rb +90 -0
  135. data/lib/mod_spox/messages/incoming/Quit.rb +18 -0
  136. data/lib/mod_spox/messages/incoming/Topic.rb +21 -0
  137. data/lib/mod_spox/messages/incoming/TopicInfo.rb +21 -0
  138. data/lib/mod_spox/messages/incoming/Welcome.rb +27 -0
  139. data/lib/mod_spox/messages/incoming/Who.rb +18 -0
  140. data/lib/mod_spox/messages/incoming/Whois.rb +49 -0
  141. data/lib/mod_spox/messages/incoming/YourHost.rb +18 -0
  142. data/lib/mod_spox/messages/internal/BotInitialized.rb +11 -0
  143. data/lib/mod_spox/messages/internal/ChangeNick.rb +15 -0
  144. data/lib/mod_spox/messages/internal/Connected.rb +20 -0
  145. data/lib/mod_spox/messages/internal/ConnectionFailed.rb +23 -0
  146. data/lib/mod_spox/messages/internal/DCCListener.rb +12 -0
  147. data/lib/mod_spox/messages/internal/DCCRequest.rb +12 -0
  148. data/lib/mod_spox/messages/internal/DCCSocket.rb +19 -0
  149. data/lib/mod_spox/messages/internal/Disconnected.rb +8 -0
  150. data/lib/mod_spox/messages/internal/Disconnecting.rb +8 -0
  151. data/lib/mod_spox/messages/internal/EstablishConnection.rb +22 -0
  152. data/lib/mod_spox/messages/internal/HaltBot.rb +8 -0
  153. data/lib/mod_spox/messages/internal/NickRequest.rb +9 -0
  154. data/lib/mod_spox/messages/internal/NickResponse.rb +15 -0
  155. data/lib/mod_spox/messages/internal/PluginLoadRequest.rb +21 -0
  156. data/lib/mod_spox/messages/internal/PluginLoadResponse.rb +17 -0
  157. data/lib/mod_spox/messages/internal/PluginModuleRequest.rb +14 -0
  158. data/lib/mod_spox/messages/internal/PluginModuleResponse.rb +18 -0
  159. data/lib/mod_spox/messages/internal/PluginReload.rb +18 -0
  160. data/lib/mod_spox/messages/internal/PluginRequest.rb +18 -0
  161. data/lib/mod_spox/messages/internal/PluginResponse.rb +21 -0
  162. data/lib/mod_spox/messages/internal/PluginUnloadRequest.rb +9 -0
  163. data/lib/mod_spox/messages/internal/PluginUnloadResponse.rb +9 -0
  164. data/lib/mod_spox/messages/internal/PluginsReady.rb +10 -0
  165. data/lib/mod_spox/messages/internal/QueueSocket.rb +8 -0
  166. data/lib/mod_spox/messages/internal/Reconnect.rb +8 -0
  167. data/lib/mod_spox/messages/internal/Request.rb +15 -0
  168. data/lib/mod_spox/messages/internal/Response.rb +15 -0
  169. data/lib/mod_spox/messages/internal/Shutdown.rb +8 -0
  170. data/lib/mod_spox/messages/internal/SignaturesUpdate.rb +8 -0
  171. data/lib/mod_spox/messages/internal/StatusRequest.rb +10 -0
  172. data/lib/mod_spox/messages/internal/StatusResponse.rb +18 -0
  173. data/lib/mod_spox/messages/internal/TimerAdd.rb +36 -0
  174. data/lib/mod_spox/messages/internal/TimerClear.rb +16 -0
  175. data/lib/mod_spox/messages/internal/TimerRemove.rb +23 -0
  176. data/lib/mod_spox/messages/internal/TimerResponse.rb +34 -0
  177. data/lib/mod_spox/messages/internal/TriggersUpdate.rb +8 -0
  178. data/lib/mod_spox/messages/internal/UnqueueSocket.rb +8 -0
  179. data/lib/mod_spox/messages/outgoing/Admin.rb +15 -0
  180. data/lib/mod_spox/messages/outgoing/Away.rb +11 -0
  181. data/lib/mod_spox/messages/outgoing/ChannelMode.rb +25 -0
  182. data/lib/mod_spox/messages/outgoing/Connect.rb +24 -0
  183. data/lib/mod_spox/messages/outgoing/Die.rb +9 -0
  184. data/lib/mod_spox/messages/outgoing/Info.rb +15 -0
  185. data/lib/mod_spox/messages/outgoing/Invite.rb +19 -0
  186. data/lib/mod_spox/messages/outgoing/Ison.rb +15 -0
  187. data/lib/mod_spox/messages/outgoing/Join.rb +19 -0
  188. data/lib/mod_spox/messages/outgoing/Kick.rb +23 -0
  189. data/lib/mod_spox/messages/outgoing/Kill.rb +19 -0
  190. data/lib/mod_spox/messages/outgoing/Links.rb +19 -0
  191. data/lib/mod_spox/messages/outgoing/List.rb +19 -0
  192. data/lib/mod_spox/messages/outgoing/Lusers.rb +19 -0
  193. data/lib/mod_spox/messages/outgoing/Motd.rb +16 -0
  194. data/lib/mod_spox/messages/outgoing/Names.rb +20 -0
  195. data/lib/mod_spox/messages/outgoing/Nick.rb +16 -0
  196. data/lib/mod_spox/messages/outgoing/Notice.rb +12 -0
  197. data/lib/mod_spox/messages/outgoing/Oper.rb +19 -0
  198. data/lib/mod_spox/messages/outgoing/Part.rb +19 -0
  199. data/lib/mod_spox/messages/outgoing/Pass.rb +16 -0
  200. data/lib/mod_spox/messages/outgoing/Ping.rb +11 -0
  201. data/lib/mod_spox/messages/outgoing/Pong.rb +17 -0
  202. data/lib/mod_spox/messages/outgoing/Privmsg.rb +43 -0
  203. data/lib/mod_spox/messages/outgoing/Quit.rb +11 -0
  204. data/lib/mod_spox/messages/outgoing/Raw.rb +16 -0
  205. data/lib/mod_spox/messages/outgoing/Rehash.rb +9 -0
  206. data/lib/mod_spox/messages/outgoing/Restart.rb +9 -0
  207. data/lib/mod_spox/messages/outgoing/ServList.rb +19 -0
  208. data/lib/mod_spox/messages/outgoing/Simple.rb +12 -0
  209. data/lib/mod_spox/messages/outgoing/Squery.rb +19 -0
  210. data/lib/mod_spox/messages/outgoing/Squit.rb +19 -0
  211. data/lib/mod_spox/messages/outgoing/Stats.rb +18 -0
  212. data/lib/mod_spox/messages/outgoing/Summon.rb +23 -0
  213. data/lib/mod_spox/messages/outgoing/Time.rb +15 -0
  214. data/lib/mod_spox/messages/outgoing/Topic.rb +19 -0
  215. data/lib/mod_spox/messages/outgoing/Trace.rb +15 -0
  216. data/lib/mod_spox/messages/outgoing/Unaway.rb +9 -0
  217. data/lib/mod_spox/messages/outgoing/User.rb +23 -0
  218. data/lib/mod_spox/messages/outgoing/UserHost.rb +15 -0
  219. data/lib/mod_spox/messages/outgoing/UserMode.rb +19 -0
  220. data/lib/mod_spox/messages/outgoing/Users.rb +15 -0
  221. data/lib/mod_spox/messages/outgoing/Version.rb +16 -0
  222. data/lib/mod_spox/messages/outgoing/Who.rb +23 -0
  223. data/lib/mod_spox/messages/outgoing/WhoWas.rb +23 -0
  224. data/lib/mod_spox/messages/outgoing/Whois.rb +19 -0
  225. data/lib/mod_spox/migrations/001_initialize_models.rb +115 -0
  226. data/lib/mod_spox/migrations/002_persistent_sigs.rb +14 -0
  227. data/lib/mod_spox/migrations/003_auth_restructure.rb +31 -0
  228. data/lib/mod_spox/migrations/004_mode_index_fix.rb +18 -0
  229. data/lib/mod_spox/migrations/005_nick_mode_nopark.rb +18 -0
  230. data/lib/mod_spox/models/Auth.rb +65 -0
  231. data/lib/mod_spox/models/AuthMask.rb +13 -0
  232. data/lib/mod_spox/models/Channel.rb +89 -0
  233. data/lib/mod_spox/models/Config.rb +30 -0
  234. data/lib/mod_spox/models/Group.rb +30 -0
  235. data/lib/mod_spox/models/Models.rb +4 -0
  236. data/lib/mod_spox/models/Nick.rb +195 -0
  237. data/lib/mod_spox/models/NickMode.rb +32 -0
  238. data/lib/mod_spox/models/Server.rb +27 -0
  239. data/lib/mod_spox/models/Setting.rb +52 -0
  240. data/lib/mod_spox/models/Signature.rb +52 -0
  241. data/lib/mod_spox/models/Trigger.rb +9 -0
  242. data/lib/mod_spox/rfc2812.rb +49 -0
  243. data/populate_gemspec.rb +15 -0
  244. data/tests/BotHolder.rb +24 -0
  245. data/tests/handlers/tc_BadNick.rb +21 -0
  246. data/tests/handlers/tc_Created.rb +24 -0
  247. data/tests/handlers/tc_Invite.rb +50 -0
  248. data/tests/handlers/tc_Join.rb +33 -0
  249. data/tests/handlers/tc_Kick.rb +32 -0
  250. data/tests/handlers/tc_Mode.rb +85 -0
  251. data/tests/handlers/tc_Names.rb +35 -0
  252. data/tests/handlers/tc_Nick.rb +55 -0
  253. data/tests/handlers/tc_Part.rb +44 -0
  254. data/tests/handlers/tc_Ping.rb +40 -0
  255. data/tests/handlers/tc_Pong.rb +28 -0
  256. data/tests/handlers/tc_Privmsg.rb +85 -0
  257. data/tests/handlers/tc_Quit.rb +40 -0
  258. data/tests/handlers/tc_Who.rb +50 -0
  259. data/tests/handlers/tc_Whois.rb +61 -0
  260. data/tests/models/tc_Auth.rb +39 -0
  261. data/tests/models/tc_Channel.rb +52 -0
  262. data/tests/models/tc_Config.rb +19 -0
  263. data/tests/models/tc_Nick.rb +144 -0
  264. data/tests/models/tc_NickMode.rb +40 -0
  265. data/tests/models/tc_Setting.rb +21 -0
  266. data/tests/models/tc_Signature.rb +14 -0
  267. data/tests/run_tests.rb +6 -0
  268. metadata +362 -0
@@ -0,0 +1,9 @@
1
+ require 'mod_spox/messages/internal/PluginLoadResponse'
2
+ module ModSpox
3
+ module Messages
4
+ module Internal
5
+ class PluginUnloadResponse < PluginLoadResponse
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ # Sends message to reload plugin. If new and stale
5
+ # attributes are set, only that plugin will be reloaded
6
+ class PluginsReady
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class QueueSocket
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class Reconnect
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class Request
5
+ # object making request
6
+ attr_reader :requester
7
+ # requester:: object making request
8
+ # Request for information
9
+ def initialize(requester)
10
+ @requester = requester
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class Response
5
+ # object response is for
6
+ attr_reader :origin
7
+ # origin:: object that requested the information
8
+ # Response of information
9
+ def initialize(origin)
10
+ @origin = origin
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class Shutdown
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class SignaturesUpdate
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ require 'mod_spox/messages/internal/Request'
2
+ module ModSpox
3
+ module Messages
4
+ module Internal
5
+ # Request current bot status
6
+ class StatusRequest < Request
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ require 'mod_spox/messages/internal/Response'
2
+ module ModSpox
3
+ module Messages
4
+ module Internal
5
+ class StatusResponse < Response
6
+ # Current status of the bot
7
+ attr_reader :status
8
+ # object:: Destination for response
9
+ # status:: Status of the bot
10
+ # Send status response to requester
11
+ def initialize(object, status)
12
+ super(object)
13
+ @status = status
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,36 @@
1
+ require 'mod_spox/messages/internal/Request'
2
+ module ModSpox
3
+ module Messages
4
+ module Internal
5
+ class TimerAdd < Request
6
+ # code block to execute
7
+ attr_reader :block
8
+ # data to supply to block
9
+ attr_reader :data
10
+ # interval between executions
11
+ attr_reader :period
12
+ # only execute block once
13
+ attr_reader :once
14
+ # message identification
15
+ attr_reader :ident
16
+ # period:: interval between executions
17
+ # once:: only run block once
18
+ # block:: code block
19
+ # Add repeating event to timer
20
+ def initialize(object, period, data=nil, once=false, &block)
21
+ super(object)
22
+ @data = data
23
+ @period = period
24
+ @once = once
25
+ @block = block
26
+ @ident = rand(99999999)
27
+ end
28
+
29
+ # Message ID
30
+ def id
31
+ @ident
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,16 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class TimerClear
5
+ attr_reader :plugin
6
+ def initialize(plugin=nil)
7
+ if(plugin.nil?)
8
+ @plugin = nil
9
+ else
10
+ @plugin = plugin.is_a?(ModSpox::Plugin) ? plugin.name.to_sym : plugin.to_sym
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,23 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class TimerRemove
5
+ # action to remove
6
+ attr_reader :action
7
+ # message identification
8
+ attr_reader :ident
9
+ # action:: action to remove from timer
10
+ # Remove action from timer
11
+ def initialize(action)
12
+ @action = action
13
+ @ident = rand(99999999)
14
+ end
15
+
16
+ # Message ID
17
+ def id
18
+ @ident
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,34 @@
1
+ require 'mod_spox/messages/internal/Response'
2
+ module ModSpox
3
+ module Messages
4
+ module Internal
5
+ class TimerResponse < Response
6
+ # action from timer
7
+ attr_reader :action
8
+ # response to message with this ID
9
+ attr_reader :ident
10
+ # object:: object to send response to
11
+ # action:: action removed from timer
12
+ # Notification that action has been removed
13
+ def initialize(object, action, added, id)
14
+ super(object)
15
+ @action = action
16
+ @added = added
17
+ @ident = id
18
+ end
19
+ # Action was added to timer
20
+ def action_added?
21
+ return @added
22
+ end
23
+ # Action was removed from timer
24
+ def action_removed?
25
+ return !@added
26
+ end
27
+ # ID of message this response is for
28
+ def id
29
+ @ident
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,8 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class TriggersUpdate
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Internal
4
+ class UnqueueSocket
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Admin
5
+ # target server
6
+ attr_reader :target
7
+ # target:: target server
8
+ # Request administrator info from target serve
9
+ def initialize(target)
10
+ @target = target
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ require 'mod_spox/messages/outgoing/Simple'
2
+ module ModSpox
3
+ module Messages
4
+ module Outgoing
5
+ # message:: away message
6
+ # Set away messages
7
+ class Away < Simple
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,25 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class ChannelMode
5
+ # channel to set mode
6
+ attr_reader :channel
7
+ # mode to set/unset
8
+ attr_reader :mode
9
+ # target of mode change
10
+ attr_reader :target
11
+ # channel:: channel to set mode in
12
+ # mode:: mode to set/unset
13
+ # target:: target of mode change
14
+ # Query/change channel modes. Target can also be used as mode
15
+ # options for cases like: MODE #chan +l 10 where the target
16
+ # would hold the limit value.
17
+ def initialize(channel, mode, target='')
18
+ @channel = channel
19
+ @mode = mode
20
+ @target = target
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Connect
5
+ # server to connect to
6
+ attr_reader :target_server
7
+ # port to connec to
8
+ attr_reader :port
9
+ # remote server to connect to target
10
+ attr_reader :remote_server
11
+ # target_server:: server to connect to
12
+ # port:: target server port
13
+ # remote_server:: remote server to connect to target
14
+ # Request a server to try to establish a connection to
15
+ # another server. This is generally an oper command.
16
+ def initialize(target_server, port, remote_server='')
17
+ @target_server = target_server
18
+ @port = port
19
+ @remote_server = remote_server
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,9 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ # Shutdown the server (oper command)
5
+ class Die
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Info
5
+ # target server
6
+ attr_reader :target
7
+ # target:: target server
8
+ # Request information about target server
9
+ def initialize(target='')
10
+ @target = target
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Invite
5
+ # nick to invite
6
+ attr_reader :nick
7
+ # channel to invite nick to
8
+ attr_reader :channel
9
+ # nick:: nick to invite
10
+ # channel:: channel to invite nick into
11
+ # Invite user into a channel
12
+ def initialize(nick, channel)
13
+ @nick = nick
14
+ @channel = channel
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Ison
5
+ # nick to check
6
+ attr_reader :nick
7
+ # nick:: nick to check
8
+ # Check if nick is on IRC
9
+ def initialize(nick)
10
+ @nick = nick
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Join
5
+ # channel to join
6
+ attr_reader :channel
7
+ # key for channel
8
+ attr_reader :key
9
+ # channel:: channel to join
10
+ # key:: channel key if needed
11
+ # Join the channel. This command only allows single joins.
12
+ def initialize(channel, key=nil)
13
+ @channel = channel
14
+ @key = key
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Kick
5
+ # nick of user to kick
6
+ attr_reader :nick
7
+ # channel to kick user out of
8
+ attr_reader :channel
9
+ # reason for kick
10
+ attr_reader :reason
11
+ # nick:: nick of user to kick
12
+ # channel:: channel to kick user out of
13
+ # reason:: reason for kick
14
+ # Request the forced removal of a user from a channel
15
+ def initialize(nick, channel, reason=nil)
16
+ @nick = nick
17
+ @channel = channel
18
+ @reason = reason
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Kill
5
+ # nick to kill
6
+ attr_reader :nick
7
+ # reason for kill
8
+ attr_reader :comment
9
+ # nick:: nick to kill
10
+ # comment:: comment about kill
11
+ # Kill connection between given nick and server
12
+ def initialize(nick, comment)
13
+ @nick = nick
14
+ @comment = comment
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Links
5
+ # remote server
6
+ attr_reader :server
7
+ # server mask
8
+ attr_reader :mask
9
+ # server:: remote server
10
+ # mask:: server mask
11
+ # List all servernames known by the server answering the query
12
+ def initialize(server, mask)
13
+ @server = server
14
+ @mask = mask
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class List
5
+ # channel to list
6
+ attr_reader :channel
7
+ # server to forward request to
8
+ attr_reader :target
9
+ # channel:: channel to list
10
+ # target:: forward to this server to supply response
11
+ # List channels and their topics
12
+ def initialize(channel, target='')
13
+ @channel = channel
14
+ @target = target
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Lusers
5
+ # mask for servers to match
6
+ attr_reader :mask
7
+ # reply from target server
8
+ attr_reader :target
9
+ # mask:: reply formed only by servers matching given mask
10
+ # target:: reply formed only by target server
11
+ # Get statistics about size of IRC network
12
+ def initialize(mask, target='')
13
+ @mask = mask
14
+ @target = target
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Motd
5
+ # server to send request to
6
+ attr_reader :target
7
+ # target:: server to send request to
8
+ # Request MOTD from target server. If no target is given
9
+ # it requests from the current server
10
+ def initialize(target='')
11
+ @target = target
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,20 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Names
5
+ # channel to request names
6
+ attr_reader :channel
7
+ # server to forward request to
8
+ attr_reader :target
9
+ # channel:: channel to request names from
10
+ # target:: forward to this server to supply response
11
+ # List visible nicknames. Supply empty string for channel
12
+ # to get entire list
13
+ def initialize(channel, target='')
14
+ @channel = channel
15
+ @target = target
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ # Give or change nickname
5
+ class Nick
6
+ # nickname
7
+ attr_reader :nick
8
+ # nick:: nickname
9
+ # Create a new Nick
10
+ def initialize(nick)
11
+ @nick = nick
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ require 'mod_spox/messages/outgoing/Privmsg'
2
+ module ModSpox
3
+ module Messages
4
+ module Outgoing
5
+ # target:: target for message
6
+ # message:: message to be sent
7
+ # Send a notice to user or channel
8
+ class Notice < Privmsg
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,19 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Oper
5
+ # login name
6
+ attr_reader :name
7
+ # user's password
8
+ attr_reader :password
9
+ # name:: login name
10
+ # password:: user's password
11
+ # Create new Oper message
12
+ def initialize(name, password)
13
+ @name = name
14
+ @password = password
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ class Part
5
+ # channel to part
6
+ attr_reader :channel
7
+ # reason for part
8
+ attr_reader :reason
9
+ # channel:: channel to part
10
+ # reason:: reason for part
11
+ # Part from channel. This command only allows single parts.
12
+ def initialize(channel, reason='')
13
+ @channel = channel
14
+ @reason = reason
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ module ModSpox
2
+ module Messages
3
+ module Outgoing
4
+ # Send PASS command
5
+ class Pass
6
+ # connection password
7
+ attr_reader :password
8
+ # password:: connection password
9
+ # Create new Pass
10
+ def initialize(password)
11
+ @password = @message
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ require 'mod_spox/messages/outgoing/Simple'
2
+ module ModSpox
3
+ module Messages
4
+ module Outgoing
5
+ # message:: string
6
+ # Send a ping
7
+ class Ping < Simple
8
+ end
9
+ end
10
+ end
11
+ end