Sha256: e82954ca37fc06f85de1e1616aaf576e96bddf0306f89b131a2540e2200e5778

Contents?: true

Size: 552 Bytes

Versions: 2

Compression:

Stored size: 552 Bytes

Contents

module MatrixQQ
  class Matrix
    module Send
      class << self
        attr_accessor :ignore
      end
      self.ignore = []

      def self.raw(dbus, room_id, event_type, body)
        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

      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

2 entries across 2 versions & 1 rubygems

Version Path
matrix_qq-0.2.0 lib/matrix_qq/matrix/send.rb
matrix_qq-0.1.1 lib/matrix_qq/matrix/send.rb