本文整理汇总了Java中eu.siacs.conversations.utils.Xmlns类的典型用法代码示例。如果您正苦于以下问题:Java Xmlns类的具体用法?Java Xmlns怎么用?Java Xmlns使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Xmlns类属于eu.siacs.conversations.utils包,在下文中一共展示了Xmlns类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pushContactToServer
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void pushContactToServer(final Contact contact) {
contact.resetOption(Contact.Options.DIRTY_DELETE);
contact.setOption(Contact.Options.DIRTY_PUSH);
final Account account = contact.getAccount();
if (account.getStatus() == Account.State.ONLINE) {
final boolean ask = contact.getOption(Contact.Options.ASKING);
final boolean sendUpdates = contact
.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)
&& contact.getOption(Contact.Options.PREEMPTIVE_GRANT);
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
iq.query(Xmlns.ROSTER).addChild(contact.asElement());
account.getXmppConnection().sendIqPacket(iq, mDefaultIqHandler);
if (sendUpdates) {
sendPresencePacket(account,
mPresenceGenerator.sendPresenceUpdatesTo(contact));
}
if (ask) {
sendPresencePacket(account,
mPresenceGenerator.requestPresenceUpdatesFrom(contact));
}
}
}
示例2: pushContactToServer
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void pushContactToServer(final Contact contact) {
contact.resetOption(Contact.Options.DIRTY_DELETE);
contact.setOption(Contact.Options.DIRTY_PUSH);
final Account account = contact.getAccount();
if (account.getStatus() == Account.State.ONLINE) {
final boolean ask = contact.getOption(Contact.Options.ASKING);
final boolean sendUpdates = contact
.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)
&& contact.getOption(Contact.Options.PREEMPTIVE_GRANT);
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
iq.query(Xmlns.ROSTER).addChild(contact.asElement());
account.getXmppConnection().sendIqPacket(iq, null);
if (sendUpdates) {
sendPresencePacket(account,
mPresenceGenerator.sendPresenceUpdatesTo(contact));
}
if (ask) {
sendPresencePacket(account,
mPresenceGenerator.requestPresenceUpdatesFrom(contact));
}
}
}
示例3: generateSetPassword
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket generateSetPassword(final Account account, final String newPassword) {
final IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
packet.setTo(account.getServer());
final Element query = packet.addChild("query", Xmlns.REGISTER);
final Jid jid = account.getJid();
query.addChild("username").setContent(jid.getLocalpart());
query.addChild("password").setContent(newPassword);
return packet;
}
示例4: requestHttpUploadSlot
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket requestHttpUploadSlot(Jid host, DownloadableFile file, String mime) {
IqPacket packet = new IqPacket(IqPacket.TYPE.GET);
packet.setTo(host);
Element request = packet.addChild("request",Xmlns.HTTP_UPLOAD);
request.addChild("filename").setContent(file.getName());
request.addChild("size").setContent(String.valueOf(file.getExpectedSize()));
if (mime != null) {
request.addChild("content-type").setContent(mime);
}
return packet;
}
示例5: fetchRosterFromServer
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void fetchRosterFromServer(final Account account) {
final IqPacket iqPacket = new IqPacket(IqPacket.TYPE.GET);
if (!"".equals(account.getRosterVersion())) {
Log.d(Config.LOGTAG, account.getJid().toBareJid()
+ ": fetching roster version " + account.getRosterVersion());
} else {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": fetching roster");
}
iqPacket.query(Xmlns.ROSTER).setAttribute("ver", account.getRosterVersion());
sendIqPacket(account, iqPacket, mIqParser);
}
示例6: deleteContactOnServer
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void deleteContactOnServer(Contact contact) {
contact.resetOption(Contact.Options.PREEMPTIVE_GRANT);
contact.resetOption(Contact.Options.DIRTY_PUSH);
contact.setOption(Contact.Options.DIRTY_DELETE);
Account account = contact.getAccount();
if (account.getStatus() == Account.State.ONLINE) {
IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
Element item = iq.query(Xmlns.ROSTER).addChild("item");
item.setAttribute("jid", contact.getJid().toString());
item.setAttribute("subscription", "remove");
account.getXmppConnection().sendIqPacket(iq, mDefaultIqHandler);
}
}
示例7: fetchRosterFromServer
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void fetchRosterFromServer(final Account account) {
final IqPacket iqPacket = new IqPacket(IqPacket.TYPE.GET);
if (!"".equals(account.getRosterVersion())) {
Log.d(Config.LOGTAG, account.getJid().toBareJid()
+ ": fetching roster version " + account.getRosterVersion());
} else {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": fetching roster");
}
iqPacket.query(Xmlns.ROSTER).setAttribute("ver",
account.getRosterVersion());
account.getXmppConnection().sendIqPacket(iqPacket, mIqParser);
}
示例8: deleteContactOnServer
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public void deleteContactOnServer(Contact contact) {
contact.resetOption(Contact.Options.PREEMPTIVE_GRANT);
contact.resetOption(Contact.Options.DIRTY_PUSH);
contact.setOption(Contact.Options.DIRTY_DELETE);
Account account = contact.getAccount();
if (account.getStatus() == Account.State.ONLINE) {
IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
Element item = iq.query(Xmlns.ROSTER).addChild("item");
item.setAttribute("jid", contact.getJid().toString());
item.setAttribute("subscription", "remove");
account.getXmppConnection().sendIqPacket(iq, null);
}
}
示例9: generateGetBlockList
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket generateGetBlockList() {
final IqPacket iq = new IqPacket(IqPacket.TYPE.GET);
iq.addChild("blocklist", Xmlns.BLOCKING);
return iq;
}
示例10: generateSetBlockRequest
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket generateSetBlockRequest(final Jid jid) {
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
final Element block = iq.addChild("block", Xmlns.BLOCKING);
block.addChild("item").setAttribute("jid", jid.toBareJid().toString());
return iq;
}
示例11: generateSetUnblockRequest
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public IqPacket generateSetUnblockRequest(final Jid jid) {
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
final Element block = iq.addChild("unblock", Xmlns.BLOCKING);
block.addChild("item").setAttribute("jid", jid.toBareJid().toString());
return iq;
}
示例12: blocking
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public boolean blocking() {
return hasDiscoFeature(account.getServer(), Xmlns.BLOCKING);
}
示例13: register
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public boolean register() {
return hasDiscoFeature(account.getServer(), Xmlns.REGISTER);
}
示例14: httpUpload
import eu.siacs.conversations.utils.Xmlns; //导入依赖的package包/类
public boolean httpUpload() {
return !Config.DISABLE_HTTP_UPLOAD && findDiscoItemsByFeature(Xmlns.HTTP_UPLOAD).size() > 0;
}