Class Jabber::MUC::XMUCUser
In: lib/xmpp4r/muc/x/muc.rb
Parent: X
XMLStanza Message Presence Iq REXML::Element X IqQuery Error StreamHost IqSiFileRange IqSiFile StreamHostUsed IqSi XRosterItem RosterItem IqFeature XMUCUserItem XMUCUserInvite XDataField XDataReported XDataTitle XDataInstructions Feature Identity Item IqVcard Singleton IdGenerator Connection Client Component Comparable JID RuntimeError AuthenticationFailure ErrorException SOCKS5Error Stream SOCKS5Bytestreams SOCKS5BytestreamsTarget SOCKS5BytestreamsInitiator SOCKS5BytestreamsServerStreamHost TCPSocket SOCKS5Socket IBB IBBTarget IBBInitiator IqQuery IqQueryBytestreams IqQueryVersion IqQueryRoster IqQueryDiscoItems IqQueryDiscoInfo Responder SimpleResponder X XRoster XMUCUser XMUC XDelay XData MUCClient SimpleMUCClient Base DigestMD5 Plain FileSource StreamParser SOCKS5BytestreamsPeer SOCKS5BytestreamsServer IBBQueueItem Helper MUCBrowser Helper Helper lib/xmpp4r/authenticationfailure.rb lib/xmpp4r/idgenerator.rb lib/xmpp4r/connection.rb lib/xmpp4r/iq.rb lib/xmpp4r/jid.rb lib/xmpp4r/xmlstanza.rb lib/xmpp4r/errorexception.rb lib/xmpp4r/stream.rb lib/xmpp4r/client.rb lib/xmpp4r/x.rb lib/xmpp4r/streamparser.rb lib/xmpp4r/error.rb lib/xmpp4r/component.rb lib/xmpp4r/query.rb lib/xmpp4r/message.rb lib/xmpp4r/presence.rb lib/xmpp4r/bytestreams/helper/ibb/initiator.rb lib/xmpp4r/bytestreams/iq/si.rb lib/xmpp4r/bytestreams/iq/bytestreams.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/base.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/target.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/server.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/socks5.rb lib/xmpp4r/bytestreams/helper/socks5bytestreams/initiator.rb lib/xmpp4r/bytestreams/helper/ibb/base.rb lib/xmpp4r/bytestreams/helper/ibb/target.rb Bytestreams lib/xmpp4r/version/iq/version.rb lib/xmpp4r/version/helper/responder.rb lib/xmpp4r/version/helper/simpleresponder.rb Version lib/xmpp4r/roster/helper/roster.rb lib/xmpp4r/roster/iq/roster.rb lib/xmpp4r/roster/x/roster.rb Roster lib/xmpp4r/feature_negotiation/iq/feature.rb FeatureNegotiation lib/xmpp4r/muc/x/muc.rb lib/xmpp4r/muc/helper/mucclient.rb lib/xmpp4r/muc/x/mucuseritem.rb lib/xmpp4r/muc/helper/mucbrowser.rb lib/xmpp4r/muc/x/mucuserinvite.rb lib/xmpp4r/muc/helper/simplemucclient.rb MUC lib/xmpp4r/sasl.rb SASL lib/xmpp4r/bytestreams/helper/filetransfer.rb TransferSource FileTransfer lib/xmpp4r/delay/x/delay.rb Delay lib/xmpp4r/dataforms/x/data.rb Dataforms lib/xmpp4r/discovery/iq/discoinfo.rb lib/xmpp4r/discovery/iq/discoitems.rb Discovery lib/xmpp4r/vcard/helper/vcard.rb lib/xmpp4r/vcard/iq/vcard.rb Vcard Jabber dot/m_60_0.png

Class for <x/> elements with namespace jabber.org/protocol/muc#user

See JEP-0058 for details

Methods

items   new   status_code   typed_add  

Public Class methods

Initialize an <x/> element and set namespace to jabber.org/protocol/muc#user

[Source]

    # File lib/xmpp4r/muc/x/muc.rb, line 51
51:       def initialize
52:         super
53:         add_namespace('http://jabber.org/protocol/muc#user')
54:       end

Public Instance methods

Get all <item/> elements

result:[Array] of [XMUCUserItem]

[Source]

    # File lib/xmpp4r/muc/x/muc.rb, line 86
86:       def items
87:         res = []
88:         each_element('item') { |item|
89:           res << item
90:         }
91:         res
92:       end

Retrieve the three-digit code in <x xmlns=‘jabber.org/protocol/muc#user'> code=’…’/></x>

result:[Fixnum] or nil

[Source]

    # File lib/xmpp4r/muc/x/muc.rb, line 73
73:       def status_code
74:         e = nil
75:         each_element('status') { |xe| e = xe }
76:         if e and e.attributes['code'].size == 3 and e.attributes['code'].to_i != 0
77:           e.attributes['code'].to_i
78:         else
79:           nil
80:         end
81:       end

Add a children element, will be imported to [XMUCUserItem] if name is "item"

[Source]

    # File lib/xmpp4r/muc/x/muc.rb, line 59
59:       def typed_add(element)
60:         if element.kind_of?(REXML::Element) && (element.name == 'item')
61:           super(XMUCUserItem::new.import(element))
62:         elsif element.kind_of?(REXML::Element) && (element.name == 'invite')
63:           super(XMUCUserInvite::new.import(element))
64:         else
65:           super(element)
66:         end
67:       end

[Validate]