use of org.awesomeapp.messenger.plugin.xmpp.XmppAddress in project Zom-Android by zom.
the class ImUrlActivity method startChat.
public void startChat(long providerId, long accountId, String username, final boolean openChat) {
if (username != null)
new ChatSessionInitTask(((ImApp) getApplication()), providerId, accountId, Imps.Contacts.TYPE_NORMAL, true) {
@Override
protected void onPostExecute(Long chatId) {
if (chatId != -1 && openChat) {
Intent intent = new Intent(ImUrlActivity.this, ConversationDetailActivity.class);
intent.putExtra("id", chatId);
startActivity(intent);
}
finish();
super.onPostExecute(chatId);
}
}.executeOnExecutor(ImApp.sThreadPoolExecutor, new Contact(new XmppAddress(username)));
}
use of org.awesomeapp.messenger.plugin.xmpp.XmppAddress in project Zom-Android by zom.
the class ChatSession method initJid.
private void initJid() {
try {
mJid = JidCreate.from(mParticipant.getAddress().getAddress());
mXa = new XmppAddress(mJid.toString());
if (mJid.hasNoResource()) {
if (!TextUtils.isEmpty(mParticipant.getAddress().getResource())) {
mJid = JidCreate.from(mParticipant.getAddress().getAddress());
} else if (mParticipant instanceof Contact) {
String resource = ((Contact) mParticipant).getPresence().getResource();
if (!TextUtils.isEmpty(resource)) {
mJid = JidCreate.from(mParticipant.getAddress().getBareAddress() + '/' + resource);
}
}
mXa = new XmppAddress(mJid.toString());
}
// not for groups yet
if (mParticipant instanceof Contact) {
// if we can't omemo, check it again to be sure
if (!mCanOmemo) {
mCanOmemo = mManager.resourceSupportsOmemo(mJid);
}
}
} catch (XmppStringprepException xe) {
throw new RuntimeException("Error with address that shouldn't happen: " + xe);
}
}
use of org.awesomeapp.messenger.plugin.xmpp.XmppAddress in project Zom-Android by zom.
the class ConversationView method startChat.
private void startChat(String username) {
if (username != null) {
new ChatSessionInitTask(((ImApp) mActivity.getApplication()), mProviderId, mAccountId, Imps.Contacts.TYPE_NORMAL, true) {
@Override
protected void onPostExecute(Long chatId) {
if (chatId != -1 && true) {
Intent intent = new Intent(mActivity, ConversationDetailActivity.class);
intent.putExtra("id", chatId);
mActivity.startActivity(intent);
}
super.onPostExecute(chatId);
}
}.executeOnExecutor(ImApp.sThreadPoolExecutor, new Contact(new XmppAddress(username)));
mActivity.finish();
}
}
use of org.awesomeapp.messenger.plugin.xmpp.XmppAddress in project Zom-Android by zom.
the class ConversationView method declineSubscription.
void declineSubscription() {
if (mConn != null) {
try {
IContactListManager manager = mConn.getContactListManager();
manager.declineSubscription(new Contact(new XmppAddress(mRemoteAddress), mRemoteNickname, Imps.Contacts.TYPE_NORMAL));
} catch (RemoteException e) {
// mHandler.showServiceErrorAlert(e.getLocalizedMessage());
LogCleaner.error(ImApp.LOG_TAG, "decline sub error", e);
}
}
}
use of org.awesomeapp.messenger.plugin.xmpp.XmppAddress in project Zom-Android by zom.
the class ConversationView method approveSubscription.
void approveSubscription() {
if (mConn != null) {
try {
IContactListManager manager = mConn.getContactListManager();
manager.approveSubscription(new Contact(new XmppAddress(mRemoteAddress), mRemoteNickname, Imps.Contacts.TYPE_NORMAL));
} catch (RemoteException e) {
// mHandler.showServiceErrorAlert(e.getLocalizedMessage());
LogCleaner.error(ImApp.LOG_TAG, "approve sub error", e);
}
}
}
Aggregations