Sha256: ac6e3464b52f192ecef71a2d67ac24a26f5e1c6a58ac51c20b3d5fb4368e49fe

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

module MatrixQQ
  class Matrix
    module Send
      class << self
        attr_accessor :ignore, :ignore_lock
      end
      self.ignore = []
      self.ignore_lock = Mutex.new

      def self.raw(dbus, room_id, event_type, body)
        ignore_lock.synchronize do
          txn_id = SecureRandom.hex(32)
          puts "send #{body}" if $VERBOSE
          res = dbus.put "/rooms/#{room_id}/send/#{event_type}/#{txn_id}", body
          ignore << (res['event_id'])
        end
      end

      def self.text(dbus, room_id, message)
        raw dbus, room_id, 'm.room.message', msgtype: 'm.text', body: message
      end
    end # Send
  end # Matrix
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
matrix_qq-0.2.1 lib/matrix_qq/matrix/send.rb