当前位置: 首页>>代码示例>>Java>>正文


Java Message.addExtension方法代码示例

本文整理汇总了Java中org.xmpp.packet.Message.addExtension方法的典型用法代码示例。如果您正苦于以下问题:Java Message.addExtension方法的具体用法?Java Message.addExtension怎么用?Java Message.addExtension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.xmpp.packet.Message的用法示例。


在下文中一共展示了Message.addExtension方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: build

import org.xmpp.packet.Message; //导入方法依赖的package包/类
/**
 * Build an XMPP error message with MMX extension.
 * @return
 */
public Message build() {
  Message errorMsg = new Message();
  String appId = JIDUtil.getAppId(mOrigMsg.getFrom());
  errorMsg.setType(Type.error);
  errorMsg.setTo(mOrigMsg.getFrom());
  errorMsg.setFrom(appId + "%" + appId + "@" + XMPPServer.getInstance().getServerInfo().getXMPPDomain());
  errorMsg.setID(mOrigMsg.getID());
  errorMsg.addExtension(new MMXPacketExtension(mHeaders, mPayload));
  return errorMsg;
}
 
开发者ID:magnetsystems,项目名称:message-server,代码行数:15,代码来源:ErrorMessageBuilder.java

示例2: sendAuthorizationRequest

import org.xmpp.packet.Message; //导入方法依赖的package包/类
/**
 * Sends an request to authorize the pending subscription to the specified owner.
 *
 * @param owner the JID of the user that will get the authorization request.
 */
public void sendAuthorizationRequest(JID owner) {
    Message authRequest = new Message();
    authRequest.addExtension(node.getAuthRequestForm(this));
    authRequest.setTo(owner);
    authRequest.setFrom(node.getService().getAddress());
    // Send authentication request to node owners
    node.getService().send(authRequest);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:14,代码来源:NodeSubscription.java

示例3: testForwarded

import org.xmpp.packet.Message; //导入方法依赖的package包/类
@Test
public void testForwarded() {
    Message message = new Message();
    message.setType(Message.Type.chat);
    message.setBody("Tests");
    message.addExtension(new DataForm(DataForm.Type.submit));

    Forwarded forwarded = new Forwarded(message);
    Forwarded forwarded2 = new Forwarded(message);
    String xml1 = forwarded.getElement().asXML();
    String xml2 = forwarded2.getElement().asXML();
    assertEquals("<forwarded xmlns=\"urn:xmpp:forward:0\"><message xmlns=\"jabber:client\" type=\"chat\"><body>Tests</body><x xmlns=\"jabber:x:data\" type=\"submit\"/></message></forwarded>", xml1);
    assertEquals("<forwarded xmlns=\"urn:xmpp:forward:0\"><message xmlns=\"jabber:client\" type=\"chat\"><body>Tests</body><x xmlns=\"jabber:x:data\" type=\"submit\"/></message></forwarded>", xml2);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:15,代码来源:ForwardTest.java

示例4: shouldNotStoreEmptyChatMessagesWithOnlyChatStates

import org.xmpp.packet.Message; //导入方法依赖的package包/类
@Test
public void shouldNotStoreEmptyChatMessagesWithOnlyChatStates() {
    Message message = new Message();
    message.setType(Message.Type.chat);
    PacketExtension chatState = new PacketExtension("composing", "http://jabber.org/protocol/chatstates");
    message.addExtension(chatState);
    assertFalse(OfflineMessageStore.shouldStoreMessage(message));
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:9,代码来源:OfflineMessageStoreTest.java

示例5: shouldNotStoreEmptyChatMessagesWithOnlyChatStatesAndThread

import org.xmpp.packet.Message; //导入方法依赖的package包/类
@Test
public void shouldNotStoreEmptyChatMessagesWithOnlyChatStatesAndThread() {
    Message message = new Message();
    message.setType(Message.Type.chat);
    message.setThread("1234");
    PacketExtension chatState = new PacketExtension("composing", "http://jabber.org/protocol/chatstates");
    message.addExtension(chatState);
    assertFalse(OfflineMessageStore.shouldStoreMessage(message));
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:10,代码来源:OfflineMessageStoreTest.java

示例6: shouldStoreEmptyChatMessagesWithOtherExtensions

import org.xmpp.packet.Message; //导入方法依赖的package包/类
@Test
public void shouldStoreEmptyChatMessagesWithOtherExtensions() {
    Message message = new Message();
    message.setType(Message.Type.chat);
    PacketExtension chatState = new PacketExtension("composing", "http://jabber.org/protocol/chatstates");
    message.addExtension(chatState);
    PacketExtension packetExtension2 = new PacketExtension("received", "urn:xmpp:receipts");
    message.addExtension(packetExtension2);
    assertTrue(OfflineMessageStore.shouldStoreMessage(message));
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:11,代码来源:OfflineMessageStoreTest.java

示例7: sendAuthorizationRequest

import org.xmpp.packet.Message; //导入方法依赖的package包/类
/**
 * Sends an request to authorize the pending subscription to the specified owner.
 *
 * @param owner the JID of the user that will get the authorization request.
 */
public void sendAuthorizationRequest(JID owner) {
    Message authRequest = new Message();
    authRequest.addExtension(node.getAuthRequestForm(this));
    authRequest.setTo(owner);
    authRequest.setFrom(service.getAddress());
    // Send authentication request to node owners
    service.send(authRequest);
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:14,代码来源:NodeSubscription.java

示例8: sendAuthorizationRequest

import org.xmpp.packet.Message; //导入方法依赖的package包/类
/**
   * Sends an request to authorize the pending subscription to the specified owner.
   *
   * @param owner the JID of the user that will get the authorization request.
   */
  public void sendAuthorizationRequest(JID owner) {
      Message authRequest = new Message();
      authRequest.addExtension(node.getAuthRequestForm(this));
      authRequest.setTo(owner);
authRequest.setFrom(node.getService().getAddress());
      // Send authentication request to node owners
node.getService().send(authRequest);
  }
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:14,代码来源:NodeSubscription.java


注:本文中的org.xmpp.packet.Message.addExtension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。