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


Java Jid.toString方法代码示例

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


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

示例1: sendBlogPostComment

import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
public BlogPostComment sendBlogPostComment(String content, BlogPost blogPost)
        throws SmackException.NotConnectedException, InterruptedException,
        XMPPException.XMPPErrorException, SmackException.NoResponseException {
    Jid jid = XMPPSession.getInstance().getUser().asEntityBareJid();
    String userName = XMPPUtils.fromJIDToUserName(jid.toString());
    Jid pubSubServiceJid = XMPPSession.getInstance().getPubSubService();

    // create stanza
    PublishCommentExtension publishCommentExtension = new PublishCommentExtension(blogPost.getId(), userName, jid, content, new Date());
    PubSub publishCommentPubSub = PubSub.createPubsubPacket(pubSubServiceJid, IQ.Type.set, publishCommentExtension, null);

    // send stanza
    XMPPSession.getInstance().sendStanza(publishCommentPubSub);

    return new BlogPostComment(publishCommentExtension.getId(),
            blogPost.getId(),
            content,
            userName,
            jid.toString(),
            publishCommentExtension.getPublished());
}
 
开发者ID:esl,项目名称:mangosta-android,代码行数:22,代码来源:BlogPostDetailsActivity.java

示例2: joined

import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
@Override
public void joined(EntityFullJid entityFullJid) {
     XmppAddress xa = new XmppAddress(entityFullJid.toString());
     ChatGroup chatGroup = mChatGroupManager.getChatGroup(xa);
     MultiUserChat muc = mChatGroupManager.getMultiUserChat(entityFullJid.asBareJid().toString());

     Occupant occupant = muc.getOccupant(entityFullJid);
     Jid jidSource = (occupant != null) ? occupant.getJid() : null;
     if (jidSource != null)
     xa = new XmppAddress(jidSource.toString());
     else
     xa = new XmppAddress(entityFullJid.toString());

     Contact mucContact = new Contact(xa, xa.getUser(), Imps.Contacts.TYPE_NORMAL);
     chatGroup.notifyMemberJoined(entityFullJid.toString(),mucContact);
    if (occupant != null) {
        chatGroup.notifyMemberRoleUpdate(mucContact, occupant.getRole().name(), occupant.getAffiliation().toString());
    }
}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:20,代码来源:XmppConnection.java

示例3: entriesDeleted

import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
@Override
public void entriesDeleted(Collection<Jid> addresses) {

    ContactList cl;
    try {
        cl = mContactListManager.getDefaultContactList();

        for (Jid address : addresses) {
            Contact contact = new Contact(new XmppAddress(address.toString()),address.toString(), Imps.Contacts.TYPE_NORMAL);
            mContactListManager.notifyContactListUpdated(cl, ContactListListener.LIST_CONTACT_REMOVED, contact);
        }


    } catch (ImException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:20,代码来源:XmppConnection.java

示例4: handleSubscribeRequest

import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
private void handleSubscribeRequest (Jid jid) throws ImException, RemoteException {
    ContactList cList = getContactListManager().getDefaultContactList();

    XmppAddress xAddr = new XmppAddress(jid.toString());
    Contact contact = new Contact(xAddr, xAddr.getUser(), Imps.Contacts.TYPE_NORMAL);
    mContactListManager.doAddContactToListAsync(contact, cList, false);

    mContactListManager.getSubscriptionRequestListener().onSubScriptionRequest(contact, mProviderId, mAccountId);

    ChatSession session = findOrCreateSession(jid.toString(), false);

    org.jivesoftware.smack.packet.Message msg = new org.jivesoftware.smack.packet.Message();
    msg.setStanzaId((Math.random()*10000f)+"subscribe");
    msg.setTo(mUserJid);
    msg.setFrom(jid);
    String message = mContext.getString(R.string.subscription_notify_text, contact.getName());
    msg.setBody(message);
    handleMessage(msg, false, false);

}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:21,代码来源:XmppConnection.java

示例5: compareTo

import org.jxmpp.jid.Jid; //导入方法依赖的package包/类
@Override
public final int compareTo(Jid  other) {
	String otherString = other.toString();
	String myString = toString();
	return myString.compareTo(otherString);
}
 
开发者ID:igniterealtime,项目名称:jxmpp,代码行数:7,代码来源:AbstractJid.java


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