Google

# File jabber4r/protocol.rb, line 817


        @thread = Jabber.gen_random_thread if @thread.nil? and (not @is_reply)

        elem = XMLElement.new("message", {"to"=>@to, "type"=>@type})

        elem.add_attribute("id", @id) if @id

        elem.add_child("thread").add_data(@thread) if @thread

        elem.add_child("subject").add_data(@subject) if @subject

        elem.add_child("body").add_data(@body) if @body

        if @xhtml then


          t.add_child("body").add_data(@xhtml)

        end

        if @type=="error" then

          e=elem.add_child("error");

          e.add_attribute("code",@errorcode) if @errorcode

          e.add_data(@error) if @error

        end



        return elem.to_s

      end