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.
- data/CHANGELOG +174 -0
- data/INSTALL +15 -0
- data/LICENSE +674 -0
- data/README.rdoc +73 -0
- data/bin/mod_spox +112 -0
- data/data/mod_spox/extras/AOLSpeak.rb +257 -0
- data/data/mod_spox/extras/AutoKick.rb +152 -0
- data/data/mod_spox/extras/AutoMode.rb +122 -0
- data/data/mod_spox/extras/AutoRejoin.rb +37 -0
- data/data/mod_spox/extras/Bash.rb +55 -0
- data/data/mod_spox/extras/Bouncer.rb +220 -0
- data/data/mod_spox/extras/Bullshit.rb +19 -0
- data/data/mod_spox/extras/Bytes.rb +11 -0
- data/data/mod_spox/extras/Confess.rb +244 -0
- data/data/mod_spox/extras/DCC.rb +182 -0
- data/data/mod_spox/extras/DevWatch.rb +153 -0
- data/data/mod_spox/extras/DownForEveryoneOrJustMe.rb +47 -0
- data/data/mod_spox/extras/EightBall.rb +33 -0
- data/data/mod_spox/extras/FML.rb +35 -0
- data/data/mod_spox/extras/FloodKicker.rb +129 -0
- data/data/mod_spox/extras/Fortune.rb +76 -0
- data/data/mod_spox/extras/GoogleIt.rb +13 -0
- data/data/mod_spox/extras/Headers.rb +59 -0
- data/data/mod_spox/extras/Karma.rb +302 -0
- data/data/mod_spox/extras/Locator.rb +44 -0
- data/data/mod_spox/extras/Logger.rb +182 -0
- data/data/mod_spox/extras/LolSpeak.rb +21 -0
- data/data/mod_spox/extras/NickServ.rb +84 -0
- data/data/mod_spox/extras/PhpCli.rb +308 -0
- data/data/mod_spox/extras/PhpFuncLookup.rb +297 -0
- data/data/mod_spox/extras/Pinger.rb +11 -0
- data/data/mod_spox/extras/Quotes.rb +79 -0
- data/data/mod_spox/extras/RegexTracker.rb +158 -0
- data/data/mod_spox/extras/Roulette.rb +267 -0
- data/data/mod_spox/extras/RubyCli.rb +93 -0
- data/data/mod_spox/extras/Search.rb +49 -0
- data/data/mod_spox/extras/Seen.rb +150 -0
- data/data/mod_spox/extras/Slashdot.rb +35 -0
- data/data/mod_spox/extras/SlashdotHeadlineGenerator.rb +500 -0
- data/data/mod_spox/extras/Talk.rb +32 -0
- data/data/mod_spox/extras/Topten.rb +103 -0
- data/data/mod_spox/extras/TracTicket.rb +66 -0
- data/data/mod_spox/extras/Translate.rb +132 -0
- data/data/mod_spox/extras/Twitter.rb +458 -0
- data/data/mod_spox/extras/UrbanDictionary.rb +55 -0
- data/data/mod_spox/extras/Weather.rb +55 -0
- data/data/mod_spox/plugins/Authenticator.rb +289 -0
- data/data/mod_spox/plugins/Banner.rb +585 -0
- data/data/mod_spox/plugins/BotNick.rb +18 -0
- data/data/mod_spox/plugins/Helper.rb +49 -0
- data/data/mod_spox/plugins/Initializer.rb +35 -0
- data/data/mod_spox/plugins/Joiner.rb +23 -0
- data/data/mod_spox/plugins/Nicker.rb +14 -0
- data/data/mod_spox/plugins/Parter.rb +23 -0
- data/data/mod_spox/plugins/Permissions.rb +60 -0
- data/data/mod_spox/plugins/PluginLoader.rb +180 -0
- data/data/mod_spox/plugins/Ponger.rb +70 -0
- data/data/mod_spox/plugins/PoolConfig.rb +52 -0
- data/data/mod_spox/plugins/Quitter.rb +15 -0
- data/data/mod_spox/plugins/Servers.rb +57 -0
- data/data/mod_spox/plugins/Status.rb +31 -0
- data/data/mod_spox/plugins/Triggers.rb +85 -0
- data/lib/mod_spox/BaseConfig.rb +51 -0
- data/lib/mod_spox/Bot.rb +604 -0
- data/lib/mod_spox/BotConfig.rb +65 -0
- data/lib/mod_spox/ConfigurationWizard.rb +180 -0
- data/lib/mod_spox/Database.rb +51 -0
- data/lib/mod_spox/Exceptions.rb +84 -0
- data/lib/mod_spox/Helpers.rb +122 -0
- data/lib/mod_spox/Loader.rb +60 -0
- data/lib/mod_spox/Logger.rb +37 -0
- data/lib/mod_spox/MessageFactory.rb +112 -0
- data/lib/mod_spox/Pipeline.rb +207 -0
- data/lib/mod_spox/Plugin.rb +97 -0
- data/lib/mod_spox/PluginHolder.rb +22 -0
- data/lib/mod_spox/PluginManager.rb +257 -0
- data/lib/mod_spox/PriorityQueue.rb +69 -0
- data/lib/mod_spox/Socket.rb +201 -0
- data/lib/mod_spox/Sockets.rb +226 -0
- data/lib/mod_spox/Timer.rb +60 -0
- data/lib/mod_spox/Version.rb +14 -0
- data/lib/mod_spox/handlers/BadNick.rb +19 -0
- data/lib/mod_spox/handlers/Bounce.rb +24 -0
- data/lib/mod_spox/handlers/Created.rb +27 -0
- data/lib/mod_spox/handlers/Handler.rb +39 -0
- data/lib/mod_spox/handlers/Invite.rb +28 -0
- data/lib/mod_spox/handlers/Join.rb +38 -0
- data/lib/mod_spox/handlers/Kick.rb +36 -0
- data/lib/mod_spox/handlers/LuserChannels.rb +19 -0
- data/lib/mod_spox/handlers/LuserClient.rb +18 -0
- data/lib/mod_spox/handlers/LuserMe.rb +16 -0
- data/lib/mod_spox/handlers/LuserOp.rb +19 -0
- data/lib/mod_spox/handlers/LuserUnknown.rb +19 -0
- data/lib/mod_spox/handlers/Mode.rb +62 -0
- data/lib/mod_spox/handlers/Motd.rb +38 -0
- data/lib/mod_spox/handlers/MyInfo.rb +24 -0
- data/lib/mod_spox/handlers/Names.rb +86 -0
- data/lib/mod_spox/handlers/Nick.rb +50 -0
- data/lib/mod_spox/handlers/NickInUse.rb +19 -0
- data/lib/mod_spox/handlers/Notice.rb +35 -0
- data/lib/mod_spox/handlers/Part.rb +39 -0
- data/lib/mod_spox/handlers/Ping.rb +25 -0
- data/lib/mod_spox/handlers/Pong.rb +23 -0
- data/lib/mod_spox/handlers/Privmsg.rb +39 -0
- data/lib/mod_spox/handlers/Quit.rb +29 -0
- data/lib/mod_spox/handlers/Topic.rb +38 -0
- data/lib/mod_spox/handlers/Welcome.rb +30 -0
- data/lib/mod_spox/handlers/Who.rb +83 -0
- data/lib/mod_spox/handlers/Whois.rb +117 -0
- data/lib/mod_spox/handlers/YourHost.rb +20 -0
- data/lib/mod_spox/messages/Messages.rb +6 -0
- data/lib/mod_spox/messages/incoming/BadNick.rb +16 -0
- data/lib/mod_spox/messages/incoming/Bounce.rb +18 -0
- data/lib/mod_spox/messages/incoming/Created.rb +15 -0
- data/lib/mod_spox/messages/incoming/Invite.rb +21 -0
- data/lib/mod_spox/messages/incoming/Join.rb +19 -0
- data/lib/mod_spox/messages/incoming/Kick.rb +26 -0
- data/lib/mod_spox/messages/incoming/LuserChannels.rb +15 -0
- data/lib/mod_spox/messages/incoming/LuserClient.rb +24 -0
- data/lib/mod_spox/messages/incoming/LuserMe.rb +18 -0
- data/lib/mod_spox/messages/incoming/LuserOp.rb +15 -0
- data/lib/mod_spox/messages/incoming/LuserUnknown.rb +15 -0
- data/lib/mod_spox/messages/incoming/Message.rb +22 -0
- data/lib/mod_spox/messages/incoming/Mode.rb +42 -0
- data/lib/mod_spox/messages/incoming/Motd.rb +18 -0
- data/lib/mod_spox/messages/incoming/MyInfo.rb +24 -0
- data/lib/mod_spox/messages/incoming/Names.rb +24 -0
- data/lib/mod_spox/messages/incoming/Nick.rb +26 -0
- data/lib/mod_spox/messages/incoming/NickInUse.rb +15 -0
- data/lib/mod_spox/messages/incoming/Notice.rb +9 -0
- data/lib/mod_spox/messages/incoming/Part.rb +21 -0
- data/lib/mod_spox/messages/incoming/Ping.rb +18 -0
- data/lib/mod_spox/messages/incoming/Pong.rb +9 -0
- data/lib/mod_spox/messages/incoming/Privmsg.rb +90 -0
- data/lib/mod_spox/messages/incoming/Quit.rb +18 -0
- data/lib/mod_spox/messages/incoming/Topic.rb +21 -0
- data/lib/mod_spox/messages/incoming/TopicInfo.rb +21 -0
- data/lib/mod_spox/messages/incoming/Welcome.rb +27 -0
- data/lib/mod_spox/messages/incoming/Who.rb +18 -0
- data/lib/mod_spox/messages/incoming/Whois.rb +49 -0
- data/lib/mod_spox/messages/incoming/YourHost.rb +18 -0
- data/lib/mod_spox/messages/internal/BotInitialized.rb +11 -0
- data/lib/mod_spox/messages/internal/ChangeNick.rb +15 -0
- data/lib/mod_spox/messages/internal/Connected.rb +20 -0
- data/lib/mod_spox/messages/internal/ConnectionFailed.rb +23 -0
- data/lib/mod_spox/messages/internal/DCCListener.rb +12 -0
- data/lib/mod_spox/messages/internal/DCCRequest.rb +12 -0
- data/lib/mod_spox/messages/internal/DCCSocket.rb +19 -0
- data/lib/mod_spox/messages/internal/Disconnected.rb +8 -0
- data/lib/mod_spox/messages/internal/Disconnecting.rb +8 -0
- data/lib/mod_spox/messages/internal/EstablishConnection.rb +22 -0
- data/lib/mod_spox/messages/internal/HaltBot.rb +8 -0
- data/lib/mod_spox/messages/internal/NickRequest.rb +9 -0
- data/lib/mod_spox/messages/internal/NickResponse.rb +15 -0
- data/lib/mod_spox/messages/internal/PluginLoadRequest.rb +21 -0
- data/lib/mod_spox/messages/internal/PluginLoadResponse.rb +17 -0
- data/lib/mod_spox/messages/internal/PluginModuleRequest.rb +14 -0
- data/lib/mod_spox/messages/internal/PluginModuleResponse.rb +18 -0
- data/lib/mod_spox/messages/internal/PluginReload.rb +18 -0
- data/lib/mod_spox/messages/internal/PluginRequest.rb +18 -0
- data/lib/mod_spox/messages/internal/PluginResponse.rb +21 -0
- data/lib/mod_spox/messages/internal/PluginUnloadRequest.rb +9 -0
- data/lib/mod_spox/messages/internal/PluginUnloadResponse.rb +9 -0
- data/lib/mod_spox/messages/internal/PluginsReady.rb +10 -0
- data/lib/mod_spox/messages/internal/QueueSocket.rb +8 -0
- data/lib/mod_spox/messages/internal/Reconnect.rb +8 -0
- data/lib/mod_spox/messages/internal/Request.rb +15 -0
- data/lib/mod_spox/messages/internal/Response.rb +15 -0
- data/lib/mod_spox/messages/internal/Shutdown.rb +8 -0
- data/lib/mod_spox/messages/internal/SignaturesUpdate.rb +8 -0
- data/lib/mod_spox/messages/internal/StatusRequest.rb +10 -0
- data/lib/mod_spox/messages/internal/StatusResponse.rb +18 -0
- data/lib/mod_spox/messages/internal/TimerAdd.rb +36 -0
- data/lib/mod_spox/messages/internal/TimerClear.rb +16 -0
- data/lib/mod_spox/messages/internal/TimerRemove.rb +23 -0
- data/lib/mod_spox/messages/internal/TimerResponse.rb +34 -0
- data/lib/mod_spox/messages/internal/TriggersUpdate.rb +8 -0
- data/lib/mod_spox/messages/internal/UnqueueSocket.rb +8 -0
- data/lib/mod_spox/messages/outgoing/Admin.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Away.rb +11 -0
- data/lib/mod_spox/messages/outgoing/ChannelMode.rb +25 -0
- data/lib/mod_spox/messages/outgoing/Connect.rb +24 -0
- data/lib/mod_spox/messages/outgoing/Die.rb +9 -0
- data/lib/mod_spox/messages/outgoing/Info.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Invite.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Ison.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Join.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Kick.rb +23 -0
- data/lib/mod_spox/messages/outgoing/Kill.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Links.rb +19 -0
- data/lib/mod_spox/messages/outgoing/List.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Lusers.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Motd.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Names.rb +20 -0
- data/lib/mod_spox/messages/outgoing/Nick.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Notice.rb +12 -0
- data/lib/mod_spox/messages/outgoing/Oper.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Part.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Pass.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Ping.rb +11 -0
- data/lib/mod_spox/messages/outgoing/Pong.rb +17 -0
- data/lib/mod_spox/messages/outgoing/Privmsg.rb +43 -0
- data/lib/mod_spox/messages/outgoing/Quit.rb +11 -0
- data/lib/mod_spox/messages/outgoing/Raw.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Rehash.rb +9 -0
- data/lib/mod_spox/messages/outgoing/Restart.rb +9 -0
- data/lib/mod_spox/messages/outgoing/ServList.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Simple.rb +12 -0
- data/lib/mod_spox/messages/outgoing/Squery.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Squit.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Stats.rb +18 -0
- data/lib/mod_spox/messages/outgoing/Summon.rb +23 -0
- data/lib/mod_spox/messages/outgoing/Time.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Topic.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Trace.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Unaway.rb +9 -0
- data/lib/mod_spox/messages/outgoing/User.rb +23 -0
- data/lib/mod_spox/messages/outgoing/UserHost.rb +15 -0
- data/lib/mod_spox/messages/outgoing/UserMode.rb +19 -0
- data/lib/mod_spox/messages/outgoing/Users.rb +15 -0
- data/lib/mod_spox/messages/outgoing/Version.rb +16 -0
- data/lib/mod_spox/messages/outgoing/Who.rb +23 -0
- data/lib/mod_spox/messages/outgoing/WhoWas.rb +23 -0
- data/lib/mod_spox/messages/outgoing/Whois.rb +19 -0
- data/lib/mod_spox/migrations/001_initialize_models.rb +115 -0
- data/lib/mod_spox/migrations/002_persistent_sigs.rb +14 -0
- data/lib/mod_spox/migrations/003_auth_restructure.rb +31 -0
- data/lib/mod_spox/migrations/004_mode_index_fix.rb +18 -0
- data/lib/mod_spox/migrations/005_nick_mode_nopark.rb +18 -0
- data/lib/mod_spox/models/Auth.rb +65 -0
- data/lib/mod_spox/models/AuthMask.rb +13 -0
- data/lib/mod_spox/models/Channel.rb +89 -0
- data/lib/mod_spox/models/Config.rb +30 -0
- data/lib/mod_spox/models/Group.rb +30 -0
- data/lib/mod_spox/models/Models.rb +4 -0
- data/lib/mod_spox/models/Nick.rb +195 -0
- data/lib/mod_spox/models/NickMode.rb +32 -0
- data/lib/mod_spox/models/Server.rb +27 -0
- data/lib/mod_spox/models/Setting.rb +52 -0
- data/lib/mod_spox/models/Signature.rb +52 -0
- data/lib/mod_spox/models/Trigger.rb +9 -0
- data/lib/mod_spox/rfc2812.rb +49 -0
- data/populate_gemspec.rb +15 -0
- data/tests/BotHolder.rb +24 -0
- data/tests/handlers/tc_BadNick.rb +21 -0
- data/tests/handlers/tc_Created.rb +24 -0
- data/tests/handlers/tc_Invite.rb +50 -0
- data/tests/handlers/tc_Join.rb +33 -0
- data/tests/handlers/tc_Kick.rb +32 -0
- data/tests/handlers/tc_Mode.rb +85 -0
- data/tests/handlers/tc_Names.rb +35 -0
- data/tests/handlers/tc_Nick.rb +55 -0
- data/tests/handlers/tc_Part.rb +44 -0
- data/tests/handlers/tc_Ping.rb +40 -0
- data/tests/handlers/tc_Pong.rb +28 -0
- data/tests/handlers/tc_Privmsg.rb +85 -0
- data/tests/handlers/tc_Quit.rb +40 -0
- data/tests/handlers/tc_Who.rb +50 -0
- data/tests/handlers/tc_Whois.rb +61 -0
- data/tests/models/tc_Auth.rb +39 -0
- data/tests/models/tc_Channel.rb +52 -0
- data/tests/models/tc_Config.rb +19 -0
- data/tests/models/tc_Nick.rb +144 -0
- data/tests/models/tc_NickMode.rb +40 -0
- data/tests/models/tc_Setting.rb +21 -0
- data/tests/models/tc_Signature.rb +14 -0
- data/tests/run_tests.rb +6 -0
- metadata +362 -0
@@ -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,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,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,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,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,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,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
|