Esempio n. 1
0
  public void destroyDirectMessage(final long id) {
    dataManager
        .destroyDirectMessage(id)
        .observeOn(AndroidSchedulers.mainThread())
        .subscribeOn(Schedulers.io())
        .subscribe(
            new Completable.CompletableSubscriber() {
              @Override
              public void onCompleted() {
                getMvpView().messageDestroyed(id);
              }

              @Override
              public void onError(Throwable e) {
                Timber.e(e, "");
              }

              @Override
              public void onSubscribe(Subscription d) {}
            });
  }
Esempio n. 2
0
  public void sendDirectMessage(long userID, String message) {
    dataManager
        .sendDirectMessage(userID, message)
        .observeOn(AndroidSchedulers.mainThread())
        .subscribeOn(Schedulers.io())
        .subscribe(
            new Subscriber<DirectMessage>() {
              @Override
              public void onCompleted() {}

              @Override
              public void onError(Throwable e) {
                Timber.e(e, "");
                getMvpView().errorSending();
              }

              @Override
              public void onNext(DirectMessage directMessage) {
                getMvpView().messageSent(directMessage);
              }
            });
  }