<commit_before>require 'whatsapp/protocol/node'

module WhatsApp
  module Protocol

    class IqMediaNode < Node

      def initialize(fingerprint, type, size, message_id = Util::IdGenerator.next)
        media_node = Node.new('media', {
            xmlns: 'w:m',
            hash:  fingerprint,
            type:  type,
            size:  size
        })

        super('iq', {
            id:   message_id,
            to:   's.whatsapp.net',
            type: 'set'
        }, [media_node])
      end

    end

  end
end
<commit_msg>Add media iq nodes to messages queue<commit_after>require 'whatsapp/protocol/node'

module WhatsApp
  module Protocol

    class IqMediaNode < Node
      attr_reader :fingerprint, :type, :size, :message_id

      def initialize(fingerprint, type, size, message_id = Util::IdGenerator.next)
        @fingerprint = fingerprint
        @type        = type
        @size        = size
        @message_id  = message_id

        media_node = Node.new('media', {
            xmlns: 'w:m',
            hash:  fingerprint,
            type:  type,
            size:  size
        })

        super('iq', {
            id:   message_id,
            to:   's.whatsapp.net',
            type: 'set'
        }, [media_node])
      end

    end

  end
end

{'fraction_non_alphanumeric': 0.10086004691164972, 'fraction_numerical': 0.0, 'mean_word_length': 1.6446280991735538, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7471933', 'n_tokens_mistral': 403, 'n_tokens_neox': 382, 'n_words': 93}