Sha256: fa2ed760546842f168dbe913cd35360f18cff341e2bd62e667d1707c97e30fb7
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
module MatrixQQ class QQ # send group massage to other class ForwardGroup class << self attr_accessor :send_to end self.send_to = Hash.new { |h, k| h[k] = [] } def initialize(dbus, matrix, info) @dbus = dbus @info = info @matrix = matrix end def run return unless @info.is_a? Hash all = run_exact room, value run_all room, value if all end def run_exact tunnel = Config[:tunnel][@info['group_id'].to_s] return false if tunnel.nil? return false unless tunnel[:type] == 'group' tunnel[:to].each_pair do |room, type| call_module room, type end MatrixQQ.intercept? tunnel end def run_all tunnel = Config[:tunnel]['group'] return if tunnel.nil? return unless tunnel[:type] == 'all' tunnel[:to].each_pair do |room, type| call_module room, type, print_room: true end end def call_module(room, type, hackin = {}) info = @info.merge hackin ForwardGroup.send_to[type.to_s].each do |func| puts "Start #{func.name}" if $VERBOSE func.new(@dbus, @matrix, info, room).run puts "End #{func.name}" if $VERBOSE end end end # Forward QQ.group << ForwardGroup end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
matrix_qq-0.4.0 | lib/matrix_qq/qq/forward_group/main.rb |