当前位置: 首页 > news >正文

网站建设SEO优化网络系统分类

网站建设SEO优化,网络系统分类,济南高新区网站建设,怎么用虚拟主机做网站步骤### javasmackopenfire即时通讯Im(四) ###* 创建群聊* 加入群聊# 创建群聊 #前面的单聊完成以后#xff0c;就开始群聊的功能把#xff0c;首先是创建群聊#xff1a;后端进行群组创建#xff1a;/***** 方法名称#xff1a;createMutiUserChat* 概要说明#xff1a;创建…### javasmackopenfire即时通讯Im(四) ###* 创建群聊* 加入群聊# 创建群聊 #前面的单聊完成以后就开始群聊的功能把首先是创建群聊后端进行群组创建/***** 方法名称createMutiUserChat* 概要说明创建群聊** param userName* param password* param roomName* param roomDesc* return void** author ZhangYH* date 2020/06/17 10:18:08*/public static String createMutiUserChat(String userName, String password,String roomName,String roomDesc){//默认使用创建人用户名时间戳为房间IDString roomId userName_System.currentTimeMillis();try {XMPPTCPConnection connection initOpenfireConnect();connection.login(userName,password);//获取房间管理对象MultiUserChatManager manager MultiUserChatManager.getInstanceFor(connection);//创建一个房间MultiUserChat muc manager.getMultiUserChat(roomIdconference.OPENFIRE_SERVICE_NAME);muc.create(userName);// User1 (which is the room owner) configures the room as a moderated roomForm form muc.getConfigurationForm();Form answerForm form.createAnswerForm();//向提交的表单添加默认答复,获取房间的默认设置菜单for(FormField field : form.getFields() ){if(!FormField.Type.hidden.name().equals(field.getType()) field.getVariable() ! null) {answerForm.setDefaultAnswer(field.getVariable());}}//muc#//房间名称answerForm.setAnswer(FormField.FORM_TYPE, http://jabber.org/protocol/muc#roomconfig);//设置房间名称answerForm.setAnswer(muc#roomconfig_roomname,roomName);//设置房间描述answerForm.setAnswer(muc#roomconfig_roomdesc, roomDesc);//是否允许修改主题answerForm.setAnswer(muc#roomconfig_changesubject, true);//设置房间最大用户数List maxusers new ArrayList();maxusers.add(100);answerForm.setAnswer(muc#roomconfig_maxusers, maxusers);List cast_values new ArrayList();cast_values.add(moderator);cast_values.add(participant);cast_values.add(visitor);answerForm.setAnswer(muc#roomconfig_presencebroadcast, cast_values);//设置为公共房间answerForm.setAnswer(muc#roomconfig_publicroom, true);//设置为永久房间answerForm.setAnswer(muc#roomconfig_persistentroom, true);//允许修改昵称answerForm.setAnswer(x-muc#roomconfig_canchangenick, true);//允许用户登录注册房间answerForm.setAnswer(x-muc#roomconfig_registration, true);muc.sendConfigurationForm(answerForm);muc.join(userName);//关闭连接closeConnection(connection);return roomId;}catch (Exception e){e.printStackTrace();}return roomId;}# 加入群聊 #/***** 方法名称joinMultiUserChat* 概要说明加入群聊** param userName* param password* param roomId* return void** author ZhangYH* date 2020/06/17 10:30:28*/public static void joinMultiUserChat(String userName, String password, String roomId) {try {XMPPTCPConnection connection initOpenfireConnect();connection.login(userName,password);// 使用XMPPConnection创建一个MultiUserChat窗口MultiUserChatManager manager MultiUserChatManager.getInstanceFor(connection);//获取会议室信息MultiUserChat muc manager.getMultiUserChat(roomIdconference.OPENFIRE_SERVICE_NAME);// 聊天室服务将会决定要接受的历史记录数量DiscussionHistory history new DiscussionHistory();history.setMaxStanzas(0);//history.setSince(new Date());// 用户加入聊天室muc.join(userName, password, history, System.currentTimeMillis());System.out.println(群聊加入成功........);//关闭连接closeConnection(connection);}catch (Exception e){e.printStackTrace();}}注openfire的群聊机制是这样的建群的时候必须要设置群组信息持久化(answerForm.setAnswer(“muc\#roomconfig\_persistentroom”, true);)要不然过一段时间群聊会自动删除的还有就是添加成员进入群聊以后当成员下线以后会自动将下线的成员踢出群聊。
http://www.yutouwan.com/news/414238/

相关文章:

  • jsp做的网站怎嘛用北京市住房城乡建设官方网站
  • 前端网站开发工具靖安县城乡规划建设局网站
  • 荣成市建设局网站是什么广东深圳职业技术学院
  • 微信公众号开发网站建设莱芜户型优化培训
  • 株洲网站建设公司成都建站优化公司
  • 长治市建设局网站linux网站服务器配置
  • 外贸公司几个网站做视频网站视频文件都存放在哪
  • 建设网站的视频视频上海网站维护
  • 消防网站建设的风格闵行区怎么读
  • php网站开发工资多少钱百度网站优点
  • 河北网站推广公司招聘58同城找工作
  • 深圳建设工程质量检测中心seo管理系统培训
  • 淘宝客的网站是怎么做的Wordpress分享到微信图标
  • 教育培训类网站建设模板城市建设协会网站
  • 塘沽建设网站公司龙口网站制作
  • 学习php网站建设微信怎么建立小程序
  • 影视网站模板怎么做盐城做网站哪家好
  • 推广优化网站排名网页跳转代码html
  • 快速建设网站方案淘宝网手机网页版
  • 二级学院英语网站建设通知巴中手机网站建设
  • 深圳住建设局网站好的网站具备什么条件
  • 网站seo合同免费小程序开发制作
  • 公司网站改版方案盛世网站集约化建设做法
  • 制作网站如何选择主机网络营销方法和手段
  • 金山专业网站建设wamp下安装wordpress
  • 青岛网站建设信息公示wordpress editor.md
  • 重庆seo整站优化外包服务建设网站了还能消除吗
  • dw制造网站log怎么做做一个网站的流程
  • 遂宁市建设局网站商城网站开发技术有哪些
  • 深圳企业网站建设电话商务网站建设软件