XMPP即时通讯协议使用(十)——好友关系状态
sub ask recv
订阅 询问 接受
含义
substatus
-1— 应该删除这个好友
Indicates that the roster item should be removed.
0— 没有建立好友关系
No subscription is established.
1— 用户已经发出好友请求
The roster owner has a subscription to the roster item’s presence.
2— 收到好友请求并且加对方好友
The roster item has a subscription to the roster owner’s presence.
3— 好友已经相互添加
The roster item and the owner have a mutual subscription.
字段的具体分析:
askstatus
-1— 没有挂起的添加好友请求。
The roster item has no pending subscription requests.
0— 有挂起的添加好友请求。
The roster item has been asked for permission to subscribe to its presence but no response has been received.
1— 估计是有没有回复的删除请求吧
The roster owner has asked the roster item to be unsubscribed from its presence notifications but hasn't yet received confi rmation.
recvstatus
-1— 已经回复添加好友请求
There are no subscriptions that have been received but not presented to the user.
1— 接收到好友请求但是没有给好友回复
The server has received a subscribe request, but has not forwarded it to the user.
2— 估计是没有回复删除请求吧
The server has received an unsubscribe request, but has not forwarded it to the user.
sub订阅:
-1 remove 发送删除用户请求
0 none 用户没有建立好友关系
1 to 发送订阅请求且请求被接受
2 from 接受好友订阅请求
3 both 双方互为好友关系
ask是否有发送订阅请求:
-1 null 没有发送好友请求
0 subscribe 发送好友订阅请求但没回复
1 unsubscribe 发送取消订阅好友请求
rec是否有接受订阅请求:
-1 null 没有收到好友订阅请求
1 sub 收到好友订阅请求但没回复
2 unsub 收到好友取消订阅请求
对方拒绝好友请求 不变 0 0 -1
对方接受好友请求 1 -1 1。
对方接受后会发好友请求 同意则 3 -1 -1收到好友申请 0 -1 1
如果 拒绝添加,则删除数据库记录
如果 接受添加,2 0 -1 。接受同时会发送好友添加请求,3 -1 -1
1申请 加2好友(2在线状态)
1 2@xxx 0 0 -1
2 1@xxx 0 -1 12 接受
1 2@xxx 1 -1 1
2 1@xxx 2 0 -12申请加1好友
1同意
1 2@xxx 3 -1 -1
2 1@xxx 3 -1 -11申请 加2好友(2未登录)
1 2@xxx 0 0 -1
2 1@xxx 0 -1 12登录
1 2@xxx 1 -1 -1
2 1@xxx 2 -1 -12 接受
1 2@xxx 3 -1 -1
2 1@xxx 3 -1 -1
JID:
一个XMPP实体的地址称为Jabber Identifier或JID,作用类似于IP地址。一个合法的JID包括节点名,域名资源名,其格式为:jid=[node'@']domain['/'resource]
XMPP协议的命名空间:
jabber:iq:private -- 私有数据存储,用于本地用户私人设置信息,比如用户备注等。
jabber:iq:conference -- 一般会议,用于多个用户之间的信息共享
jabber:x:encrypted -- 加密的消息,用于发送加密消息
jabber:x:expire -- 消息终止
jabber:iq:time -- 客户端时间
jabber:iq:auth -- 简单用户认证,一般用于服务器之间或者服务器和客户端之间的认证
jabber:x:roster -- 内部花名册
jabber:x:signed -- 标记的在线状态
jabber:iq:search -- 用户数据库查询,用于向服务器发送查询请求
jabber:iq:register -- 注册请求,用于用户注册相关信息
jabber:x:iq:roster -- 花名册管理
jabber:x:conference -- 会议邀请,用于向参加会议用户发送开会通知
jabber:x:event -- 消息事件
vcard-temp -- 临时的vCard,用于设置用户的头像以及昵称等
XMPP即时通讯协议使用(十)——好友关系状态的更多相关文章
- XMPP即时通讯协议使用(前传)——协议详解
XMPP详解 XMPP(eXtensible Messaging and Presence Protocol,可扩展消息处理和现场协议)是一种在两个地点间传递小型结构化数据的协议.在此基础上,XMPP ...
- XMPP即时通讯协议使用(十二)——基于xmpp搭建简单的局域网WebRTC
创建HTML和JS ofwebrtc.html <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" ...
- XMPP即时通讯协议使用(七)——利用Strophe实现WebIM及strophe.plugins插件使用
Strophe简介与Openfire配置 Strophe.js是为XMPP写的一个js类库.因为http协议本身不能实现持久连接,所以strophe利用BOSH模拟实现持久连接. 官方文档: http ...
- xmpp即时通讯协议的特性---长处和缺点!
xmpp协议的定义? XMPP是一种基于标准通用标记语言的子集XML的协议,它继承了在XML环境中灵活的发展性. 因此.基于XMPP的应用具有超强的可扩展性.经过扩展以后的XMPP能够通过发送扩展的信 ...
- XMPP即时通讯协议使用(六)——开发Openfire聊天记录插件
转载地址:http://www.cnblogs.com/hoojo/archive/2013/03/29/openfire_plugin_chatlogs_plugin_.html 开发环境: Sys ...
- XMPP即时通讯协议使用(四)——Openfire服务器源码编译与添加消息记录保存
下载Openfire源码 下载地址:https://www.igniterealtime.org/downloads/index.jsp,当前最新版本为:4.2.3 Eclipse上部署Openfir ...
- XMPP即时通讯协议使用(三)——订阅发布、断开重连与Ping
package com.testV3; import java.util.List; import org.jivesoftware.smack.ConnectionListener; import ...
- XMPP即时通讯协议使用(二)——基于Smack相关操作
package com.test; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator ...
- XMPP即时通讯协议使用(十一)——Openfire表结构汇总
行号 字段名称 字段描述 字段类型 长度 主键 说明 允许为空 用户组数据表(ofGroup) 1 groupName 组名 varchar2 50 ★ NOT NULL 2 descriptio ...
随机推荐
- Beta-星期五
所属课程 https://edu.cnblogs.com/campus/xnsy/SoftwareEngineeringClass 作业要求 https://edu.cnblogs.com/camp ...
- Linux ct6.5安装rabbitmq
yum install gcc glibc-devel make ncurses-devel openssl-devel xmlto 1.Erlang安装配置 下载安装包,地址http://www.e ...
- Linux中检查内存使用情况的命令
Linux操作系统包含大量工具,所有这些工具都可以帮助您管理系统.从简单的文件和目录工具到非常复杂的安全命令,在Linux上没有太多不能做的事情.而且,虽然普通桌面用户可能不需要在命令行熟悉这些工具, ...
- hive之压缩
对数据进行压缩可以节约磁盘空间,提高系统吞吐量和性能,但是压缩和解压缩会增加CPU的开销. 1.hive的压缩编/解码器 BZip2和GZip压缩率高,但是需要消耗较多的CPU开销.LZO和Snapp ...
- 【leetcode】823. Binary Trees With Factors
题目如下: Given an array of unique integers, each integer is strictly greater than 1. We make a binary t ...
- 转:C++ 11 Lambda表达式
转:https://www.cnblogs.com/DswCnblog/p/5629165.html C++11的一大亮点就是引入了Lambda表达式.利用Lambda表达式,可以方便的定义和创建匿名 ...
- LOJ 2978 「THUSCH 2017」杜老师——bitset+线性基+结论
题目:https://loj.ac/problem/2978 题解:https://www.cnblogs.com/Paul-Guderian/p/10248782.html 第 i 个数的 bits ...
- socket | netcat 模拟
#!/opt/local/bin/python2.7 #coding=utf-8 ''' 取代netcat 两台主机中其中一台控制另一台 得到北控方的shell ''' import sys impo ...
- 【GDAL】聊聊GDAL的数据模型
GDAL是个非常优秀的GIS数据操作库,最近在和实习生介绍GDAL的简单使用,顺手写下记录 本篇记录栅格数据,代码环境为C# 在GDAL中,栅格数据大致是以一个Dataset对应一个栅格数据文件(.T ...
- [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent c ...