use of org.awesomeapp.messenger.service.IContactListManager in project Zom-Android by zom.
the class ContactsListFragment method unarchiveContact.
private static void unarchiveContact(Activity activity, String address, int contactType, long providerId, long accountId) {
try {
IImConnection mConn;
ImApp app = ((ImApp) activity.getApplication());
mConn = app.getConnection(providerId, accountId);
// then delete the contact from our list
IContactListManager manager = mConn.getContactListManager();
int res = manager.archiveContact(address, contactType, false);
if (res != ImErrorInfo.NO_ERROR) {
// mHandler.showAlert(R.string.error,
// ErrorResUtils.getErrorRes(getResources(), res, address));
}
} catch (RemoteException re) {
}
}
use of org.awesomeapp.messenger.service.IContactListManager in project Zom-Android by zom.
the class ContactsListFragment method deleteContact.
private static void deleteContact(Activity activity, long itemId, String address, long providerId, long accountId) {
try {
IImConnection mConn;
ImApp app = ((ImApp) activity.getApplication());
mConn = app.getConnection(providerId, accountId);
// first leave, delete an existing chat session
IChatSessionManager sessionMgr = mConn.getChatSessionManager();
if (sessionMgr != null) {
IChatSession session = sessionMgr.getChatSession(Address.stripResource(address));
}
// then delete the contact from our list
IContactListManager manager = mConn.getContactListManager();
int res = manager.removeContact(address);
if (res != ImErrorInfo.NO_ERROR) {
// mHandler.showAlert(R.string.error,
// ErrorResUtils.getErrorRes(getResources(), res, address));
}
} catch (RemoteException re) {
}
}
use of org.awesomeapp.messenger.service.IContactListManager in project Zom-Android by zom.
the class AddContactActivity method getContactList.
private IContactList getContactList(IImConnection conn) {
if (conn == null) {
return null;
}
try {
IContactListManager contactListMgr = conn.getContactListManager();
// getSelectedListName();
String listName = "";
if (!TextUtils.isEmpty(listName)) {
return contactListMgr.getContactList(listName);
} else {
// Use the default list
List<IBinder> lists = contactListMgr.getContactLists();
for (IBinder binder : lists) {
IContactList list = IContactList.Stub.asInterface(binder);
if (list.isDefault()) {
return list;
}
}
// No default list, use the first one as default list
if (!lists.isEmpty()) {
return IContactList.Stub.asInterface(lists.get(0));
}
return null;
}
} catch (RemoteException e) {
// If the service has died, there is no list for now.
return null;
}
}
use of org.awesomeapp.messenger.service.IContactListManager in project Zom-Android by zom.
the class ContactDisplayActivity method doDeleteContact.
void doDeleteContact() {
try {
IImConnection mConn;
mConn = ((ImApp) getApplication()).getConnection(mProviderId, mAccountId);
IContactListManager manager = mConn.getContactListManager();
int res = manager.removeContact(mUsername);
if (res != ImErrorInfo.NO_ERROR) {
// mHandler.showAlert(R.string.error,
// ErrorResUtils.getErrorRes(getResources(), res, address));
}
} catch (RemoteException re) {
}
}
use of org.awesomeapp.messenger.service.IContactListManager in project Zom-Android by zom.
the class ContactListItem method deleteContact.
void deleteContact() {
try {
IImConnection mConn;
ImApp app = ((ImApp) ((Activity) getContext()).getApplication());
mConn = app.getConnection(mHolder.mProviderId, mHolder.mAccountId);
IContactListManager manager = mConn.getContactListManager();
int res = manager.removeContact(address);
if (res != ImErrorInfo.NO_ERROR) {
// mHandler.showAlert(R.string.error,
// ErrorResUtils.getErrorRes(getResources(), res, address));
}
} catch (RemoteException re) {
}
}
Aggregations