持久XMPP MUC(XEP-45),例如WhatsApp小组讨论 [英] Persistent XMPP MUC (XEP-45), like WhatsApp groupchats

查看:140
本文介绍了持久XMPP MUC(XEP-45),例如WhatsApp小组讨论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据规范—

7.14退出房间

为了退出多用户聊天室,居住者发送了在线状态 < room @ service/nick>类型为不可用"的节它是 目前正在房间里使用.

示例80.乘员离开房间

<presence
    from='hag66@shakespeare.lit/pda'
    to='coven@chat.shakespeare.lit/thirdwitch'
    type='unavailable'/>

这意味着,一旦用户与XMPP服务器断开连接,他就会从服务器端的组中删除.问题很简单-我不想要这种行为;我想要的行为类似于Whatsapp的行为,即即使用户脱机,他仍然是MUC机房的一部分(配置为在服务器端是永久性的),并将接收来自其他占用者的消息.

考虑到iOS的XEP-0045和XMPPFramework的规范和文档,我不知道如何实现这一目标,或者不知道是否有可能在传统的ejabberd服务器中实现这一目标.

解决方案

XEP-45的设计早于10年前.那时,设计师想到的是类似IRC渠道的产品. XEP-45的所有设计都是基于这样的假设,即用户在启动/终止其客户时进入和离开房间.

WhatsApp群组聊天的不同之处:用户加入群组聊天可以查看该聊天的(完整)历史记录.即使用户客户端处于脱机状态/不可用,他仍被视为群聊的一部分.

XMPP社区当前正在使用提供这种功能的新XEP.它称为 XEP-0369:中介信息交换 .它是XEP-0045的精神继任者,提供了人们期望从现代小组聊天中获得的功能.

From the spec —

7.14 Exiting a Room

In order to exit a multi-user chat room, an occupant sends a presence stanza of type "unavailable" to the <room@service/nick> it is currently using in the room.

Example 80. Occupant Exits a Room

<presence
    from='hag66@shakespeare.lit/pda'
    to='coven@chat.shakespeare.lit/thirdwitch'
    type='unavailable'/>

This implies that as soon as the user disconnects from the XMPP server, he is removed from the group on the server side. The issue is simple — I don't want this behavior; I want a behavior that is similar to what Whatsapp does, i.e. even if the user goes offline, he is still part of the MUC room (which is configured to be persistent on the server side) and will receive messages from other occupants.

Given the spec and the documentation for XEP-0045 and XMPPFramework for iOS, I have no idea how to accomplish this or if it's possible to accomplish this in the traditional ejabberd server.

解决方案

XEP-45 was designed more then 10 years ago. Back then, the designers had something like IRC channels in mind. Everything of XEP-45 is designed based on the assumption that a user enters and leaves a room when he/she starts/terminates its client.

WhatsApp Groupchats are different: A user joins a groupchat is is able to view the (complete) history of that chat. Even if the users client is offline/unavailable, he is still considered part of the groupchat.

The XMPP community currently works on a new XEP that provides such functionality. It is called XEP-0369: Mediated Information eXchange. It is the spiritual successor of XEP-0045, providing the features one would expect from modern groupchats.

这篇关于持久XMPP MUC(XEP-45),例如WhatsApp小组讨论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆