Skip to content
Snippets Groups Projects
Commit bc852c1c authored by Adrien Béraud's avatar Adrien Béraud Committed by Hadrien De Sousa
Browse files

jni: update for new removeContact API


Add distinction between removing a contact
and banning it.

Change-Id: I9d8dd8e544b8e907e23d8b7fafa6bcccbed49ca4
Reviewed-by: default avatarHadrien De Sousa <hadrien.desousa@savoirfairelinux.com>
parent 4178e3dc
No related branches found
No related tags found
No related merge requests found
......@@ -625,7 +625,7 @@ public class DRingService extends Service implements Observer<ServiceEvent> {
break;
case ACTION_TRUST_REQUEST_BLOCK:
mAccountService.discardTrustRequest(account, from);
mContactService.removeContact(account, from);
mContactService.removeContact(account, from, true);
break;
}
}
......
......@@ -175,7 +175,7 @@ public class PendingContactRequestsPresenter extends RootPresenter<PendingContac
String accountId = mAccountID == null ? mAccountService.getCurrentAccount().getAccountID() : mAccountID;
String contactId = viewModel.getContactId();
mAccountService.discardTrustRequest(accountId, contactId);
mContactService.removeContact(accountId, contactId);
mContactService.removeContact(accountId, contactId, true);
mPreferencesService.removeRequestPreferences(accountId, contactId);
updateList(true);
}
......
......@@ -156,7 +156,7 @@ public class ConversationPresenter extends RootPresenter<ConversationView> imple
contactId = split[1];
}
mContactService.removeContact(accountId, contactId);
mContactService.removeContact(accountId, contactId, true);
getView().goToHome();
}
......
......@@ -356,7 +356,7 @@ public abstract class ContactService extends Observable {
* @param accountId
* @param uri
*/
public void removeContact(final String accountId, final String uri) {
public void removeContact(final String accountId, final String uri, final boolean ban) {
FutureUtils.executeDaemonThreadCallable(
mExecutor,
......@@ -366,7 +366,7 @@ public abstract class ContactService extends Observable {
@Override
public Boolean call() throws Exception {
Log.i(TAG, "removeContact() thread running...");
Ringservice.removeContact(accountId, uri);
Ringservice.removeContact(accountId, uri, ban);
return true;
}
}
......
......@@ -368,7 +368,7 @@ public class SmartListPresenter extends RootPresenter<SmartListView> implements
public void removeContact(String accountId, String contactId) {
String[] split = contactId.split(":");
if (split.length > 1 && split[0].equals("ring")) {
mContactService.removeContact(accountId, split[1]);
mContactService.removeContact(accountId, split[1], false);
}
}
......
......@@ -186,7 +186,7 @@ void sendTrustRequest(const std::string& accountId, const std::string& to, const
/* Contacts */
void addContact(const std::string& accountId, const std::string& uri);
void removeContact(const std::string& accountId, const std::string& uri);
void removeContact(const std::string& accountId, const std::string& uri, const bool& ban);
std::vector<std::map<std::string, std::string>> getContacts(const std::string& accountId);
int exportAccounts(std::vector<std::string> accountIDs, std::string toDir, std::string password);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment