xmpp muc 단체 채팅 프로토콜 3

17638 단어
xmpp muc 단체 채팅 프로토콜 3

6. Entity Use Cases


A MUC implementation MUST support Service Discovery [7].
서비스 디스커버는 반드시 서비스 디스커버를 실현해야 한다

6.1 Discovering Component Support for MUC


서버가 muc를 지원하는지 확인
A Jabber entity may wish to discover if a service implements the Multi-User Chat protocol; in order to do so, it sends a service discovery information ("disco#info") query to the component's JID:
jabber 실체가 서버에 muc 프로토콜을 지원하는지 물어볼 것입니다.
예1: 사용자가muc의 프로토콜을 지원하는지 서버에 묻기
iq get 프로토콜 xmlns = "http://jabber.org/protocol/disco#info"
<iq from='[email protected]/pda' fuul jid
    id='disco1'
    to='chat.shakespeare.lit'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
   

The service MUST return its identity and the features it supports:
서버는 muc 그룹 채팅 지원 여부를 되돌려야 합니다
Example 2. Service Returns Disco Info Results
<iq from='chat.shakespeare.lit'  
    id='disco1'
    to='[email protected]/pda' jid
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity
        category='conference'
        name='Macbeth Chat Service'
        type='text'/>
    <feature var='http://jabber.org/protocol/muc'/>
  </query>
</iq>
   

Note: Because MUC is a superset of the old "groupchat 1.0"protocol, a MUC service SHOULD NOT return a entry in a disco#info result.

6.2 Discovering Rooms


방을 발견하다
The service discovery items ("disco#items") protocol enables a user to query a service for a list of associated items, which in the case of a chat service would consist of the specific chat rooms hosted by the service.
Example 3. User Queries Chat Service for Rooms
<iq from='[email protected]/pda' jid
    id='disco2'
    to='chat.shakespeare.lit' server
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
   

The service SHOULD return a full list of the rooms it hosts.
Example 4. Service Returns Disco Item Results
서버가 disco item의 결과를 되돌려줍니다.
<iq from='chat.shakespeare.lit' server
    id='disco2'
    to='[email protected]/pda' jid
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#items'>
    <item jid='[email protected]'
          name='A Lonely Heath'/>
    <item jid='[email protected]'
          name='A Dark Cave'/>
    <item jid='[email protected]'
          name='The Palace'/>
    <item jid='[email protected]'
          name='Macbeth&apos;s Castle'/>
  </query>
</iq>
   

If the full list of rooms is large (see XEP-0030 for details), the service MAY return only a partial list of rooms. If it does so, it SHOULD include a element (as defined in Result Set Management [8]) to indicate that the list not the full result set.
모든 방의 목록이 너무 길면 서버는 일부 방의 목록을 되돌릴 수 있습니다.만약 이렇게 한다면 서버가 되돌아오는 내용은 set 노드를 포함해야 합니다. 되돌아오는 목록이 모든 목록이 아니라는 것을 의미합니다
Example 5. Service Returns Limited List of Disco Item Results
<iq from='rooms.shakespeare.lit' server
    id='disco-rsm-1'
    to='[email protected]/pda'jid
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#items'>
    <item jid='[email protected]'/> itmes
    <item jid='[email protected]'/>
    <item jid='[email protected]'/>
    <item jid='[email protected]'/>
    <item jid='[email protected]'/>
    <item jid='[email protected]'/>
    <item jid='[email protected]'/>
    <item jid='[email protected]'/>
    <item jid='[email protected]'/>
    <item jid='[email protected]'/>
    <set xmlns='http://jabber.org/protocol/rsm'>
      <first index='0'>[email protected]</first>
      <last>[email protected]</last>
      <count>37</count>
    </set>
  </query>
</iq>
   

6.3 Querying for Room Information


방 메시지 조회
Using the disco#info protocol, a user may also query a specific chat room for more detailed information about the room. A user SHOULD do so before entering a room in order to determine the privacy and security profile of the room configuration (see the Security Considerations for details).
disco#info 프로토콜을 사용하면 사용자도 지정한 방의 정보를 조회할 수 있습니다. 사용자는 한 방에 들어가기 전에 이 방의 프라이버시와 보안 설정을 확인해야 합니다.
Example 6. User Queries for Information about a Specific Chat Room
<iq from='[email protected]/pda' jid
    id='disco3'
    to='[email protected]' roomid
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
   

The room MUST return its identity and SHOULD return the features it supports:
방은 반드시 그의 속성으로 돌아가야 한다
Example 7. Room Returns Disco Info Results
<iq from='[email protected]' roomid
    id='disco3'
    to='[email protected]/pda' jid
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity
        category='conference'
        name='A Dark Cave'
        type='text'/>
    <feature var='http://jabber.org/protocol/muc'/>
    <feature var='muc_passwordprotected'/>
    <feature var='muc_hidden'/>
    <feature var='muc_temporary'/>
    <feature var='muc_open'/>
    <feature var='muc_unmoderated'/>
    <feature var='muc_nonanonymous'/>
  </query>
</iq>
   

Note: Because MUC is a superset of the old "groupchat 1.0"protocol, a MUC room SHOULD NOT return a entry in a disco#info result. The room SHOULD return the materially-relevant features it supports, such as password protection and room moderation (these are listed fully in the feature registry maintained by the XMPP Registrar; see also the XMPP Registrar section of this document).
유용한 지원 특징을 되돌려야 한다.예를 들어 비밀번호 방이냐,moderation 방이냐 등이다.
A chatroom MAY return more detailed information in its disco#info response using Service Discovery Extensions [9], identified by inclusion of a hidden FORM_TYPE field whose value is "http://jabber.org/protocol/muc#roominfo". Such information might include a more verbose description of the room, the current room subject, and the current number of occupants in the room:
한 채팅방은 muc#roominfo라는 확장된 xmlns로 더 많은 방 정보, 예를 들어 방 사용자의 정보를 포함할 수 있습니다.
Example 8. Room Returns Extended Disco Info Results
<iq from='[email protected]'
    id='disco3a'
    to='[email protected]/pda'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity
        category='conference'
        name='A Dark Cave'
        type='text'/>
    <feature var='http://jabber.org/protocol/muc'/>
    <feature var='muc_passwordprotected'/>
    <feature var='muc_hidden'/>
    <feature var='muc_temporary'/>
    <feature var='muc_open'/>
    <feature var='muc_unmoderated'/>
    <feature var='muc_nonanonymous'/>
    <x xmlns='jabber:x:data' type='result'>
      <field var='FORM_TYPE' type='hidden'>
        <value>http://jabber.org/protocol/muc#roominfo</value>
      </field>
      <field var='muc#roominfo_description' label='Description'>
        <value>The place for all good witches!</value>
      </field>
      <field var='muc#roominfo_changesubject' label='Whether Occupants May Change the Subject'>
        <value>true</value>
      </field>
      <field var='muc#roominfo_contactjid' label='Contact Addresses'>
        <value>[email protected]</value>
      </field>
      <field var='muc#roominfo_subject' label='Subject'>
        <value>Spells</value>
      </field>
      <field var='muc#roomconfig_changesubject' label='Subject can be modified'>
        <value>true</value>
      </field>
      <field var='muc#roominfo_occupants' label='Number of occupants'>
        <value>3</value>
      </field>
      <field var='muc#roominfo_ldapgroup' label='Associated LDAP Group'>
        <value>dc=lit,dc=shakespeare,cn=witches</value>
      </field>
      <field var='muc#roominfo_lang' label='Language of discussion'>
        <value>en</value>
      </field>
      <field var='muc#roominfo_logs' label='URL for discussion logs'>
        <value>http://www.shakespeare.lit/chatlogs/darkcave/</value>
      </field>
      <field var='muc#roominfo_pubsub' label='Associated pubsub node'>
        <value>xmpp:pubsub.shakespeare.lit?;node=the-darkcave-node</value>
      </field>
    </x>
  </query>
</iq>
   

Some extended room information may be dynamically generated (e.g., the URL for discussion logs, which may be based on service-wide configuration). Other information may be based on the room configuration, which is why any field defined for the muc#roomconfig FORM_TYPE can be included in the extended service discovery fields (as shown above for the muc#roomconfig_changesubject field).
Note: The foregoing extended service discovery fields for the 'http://jabber.org/protocol/muc#roominfo' FORM_TYPE may be supplemented in the future via the mechanisms described in the Field Standardization section of this document.

6.4 Querying for Room Items


방 항목 조회
A user MAY also query a specific chat room for its associated items:
한 사용자가 특정한 채팅방의 일부 item에 대해 물어볼 수 있다
Example 9. User Queries for Items Associated with a Specific Chat Room
<iq from='[email protected]/pda' jid
    id='disco4'
    to='[email protected]' roomid
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
   

An implementation MAY return a list of existing occupants if that information is publicly available, or return no list at all if this information is kept private.
서비스 측은 방 안에 있는occupants의 정보 목록을 되돌려 줄 수 있습니다.이 방 때 퍼블릭이
Example 10. Room Returns Disco Item Results (Items are Public)
<iq from='[email protected]' roomid
    id='disco4'
    to='[email protected]/pda' jid
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#items'>
    <item jid='[email protected]/firstwitch'/> roomjid
    <item jid='[email protected]/secondwitch'/> roomjid
  </query>
</iq>
   

Note: These elements are qualified by the disco#items namespace, not the muc namespace; this means that they cannot possess 'affiliation' or 'role' attributes, for example.
item절은disco#items라는 xmlns에 포함되어 있습니다. muc가 아니라affiliation과role 속성이 있을 수 없기 때문입니다.예를 들어 공백으로 돌아갈 수 있다.
Example 11. Room Returns Empty Disco Item Results (Items are Private)
<iq from='[email protected]' roomid
    id='disco4'
    to='[email protected]/pda' jid
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
   

6.5 Querying a Room Occupant


한 방의 occupant 조회
If a non-occupant attempts to send a disco request to an address of the form , a MUC service SHOULD return the request to the entity and specify a error condition. If an occupant sends such a request, the service MAY pass it through the intended recipient; see the Implementation Guidelines section of this document for details.
non-occupant가 디스코 요청을 방에 보내려고 하면 기각됩니다.

6.6 Discovering Client Support for MUC


muc에 대한 사용자 지원 조회
A Jabber user may want to discover if one of the user's contacts supports the Multi-User Chat protocol. This is done using Service Discovery.
jabber 사용자가 다른 사용자가muc의 채팅 프로토콜을 지원하는지 조회하고 싶어 할 수도 있습니다
Example 12. User Queries Contact Regarding MUC Support
<iq from='[email protected]/pda' jid
    id='disco5'
    to='[email protected]/laptop' jid
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
   

The client SHOULD return its identity and the features it supports:
클라이언트는 그룹 채팅 프로토콜을 지원하는지 되돌려야 합니다
Example 13. Contact Returns Disco Info Results
<iq from='[email protected]/laptop'
    id='disco5'
    to='[email protected]/pda'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity
        category='client'
        type='pc'/>
    ...
    <feature var='http://jabber.org/protocol/muc'/>
    ...
  </query>
</iq>
   

A user may also query a contact regarding which rooms the contact is in. This is done by querying the contact's full JID () while specifying the well-known Service Discovery node 'http://jabber.org/protocol/muc#rooms':
한 사용자가 다른 사용자가 그 방에 있는지 알고 싶을 수도 있다.muc#rooms 포함
Example 14. User Queries Contact for Current Rooms
<iq from='[email protected]/pda' jid
    id='rooms1'
    to='[email protected]/laptop' jid
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#items'
         node='http://jabber.org/protocol/muc#rooms'/>
</iq>
   

Example 15. Contact Returns Room Query Results
<iq from='[email protected]/laptop' jid
    id='rooms1'
    to='[email protected]/pda' jid
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#items'
         node='http://jabber.org/protocol/muc#rooms'>
    <item jid='[email protected]'/> item
    <item jid='[email protected]'/>
  </query>
</iq>
   

Optionally, the contact MAY include its roomnick as the value of the 'name' attribute:
사용자 닉네임을 가지고 돌아올 수도 있다.
    ...
    <item jid='[email protected]'
          name='secondwitch'/>
    ...
   

좋은 웹페이지 즐겨찾기