Tabnine Logo
MXSession.getDataHandler
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataHandler
method
in
org.matrix.androidsdk.MXSession

Best Java code snippets using org.matrix.androidsdk.MXSession.getDataHandler (Showing top 20 results out of 315)

origin: matrix-org/matrix-android-sdk

/**
 * Tells if an user is in the ignored user ids list
 *
 * @param userId the user id to test
 * @return true if the user is ignored
 */
public boolean isUserIgnored(String userId) {
  if (null != userId) {
    return getDataHandler().getIgnoredUserIds().indexOf(userId) >= 0;
  }
  return false;
}
origin: matrix-org/matrix-android-sdk

@Override
public void onStoreCorrupted(String accountId, String description) {
  Log.d(LOG_TAG, "## onStoreCorrupted() : token " + getDataHandler().getStore().getEventStreamToken());
  // nothing was saved
  if (null == getDataHandler().getStore().getEventStreamToken()) {
    getDataHandler().onStoreReady();
  }
}
origin: tijder/SmsMatrix

@Override
public void onStoreReady(String s) {
  session.getDataHandler().checkPermanentStorageData();
  session.startEventStream(store.getEventStreamToken());
  session.getDataHandler().addListener(evLis);
}
origin: matrix-org/matrix-android-sdk

@Override
public void onStoreReady(String accountId) {
  Log.d(LOG_TAG, "## onStoreReady()");
  getDataHandler().onStoreReady();
}
origin: matrix-org/matrix-android-sdk

  @Override
  public void run() {
    fEvent.setClearData(fResut);
    mSession.getDataHandler().onEventDecrypted(fEvent);
  }
});
origin: matrix-org/matrix-android-sdk

/**
 * Tells if the global URL preview settings is enabled
 *
 * @return true if it is enabled.
 */
public boolean isURLPreviewEnabled() {
  return getDataHandler().getStore().isURLPreviewEnabled();
}
origin: matrix-org/matrix-android-sdk

/**
 * Get user widget from user AccountData
 *
 * @return
 */
public Map<String, Object> getUserWidgets() {
  return getDataHandler().getStore().getUserWidgets();
}
origin: matrix-org/matrix-android-sdk

/**
 * When the encryption is toogled, the room summaries must be updated
 * to display the right messages.
 */
private void decryptRoomSummaries() {
  if (null != getDataHandler().getStore()) {
    Collection<RoomSummary> summaries = getDataHandler().getStore().getSummaries();
    for (RoomSummary summary : summaries) {
      mDataHandler.decryptEvent(summary.getLatestReceivedEvent(), null);
    }
  }
}
origin: matrix-org/matrix-android-sdk

  @Override
  public void onSuccess(FilterResponse filter) {
    // Store the couple filter/filterId
    getDataHandler().getStore().addFilter(wantedJsonFilter, filter.filterId);
    // Ensure the filter is still corresponding to the current filter
    if (TextUtils.equals(wantedJsonFilter, mCurrentFilter.toJSONString())) {
      // Tell the event thread to use the id now
      mEventsThread.setFilterOrFilterId(filter.filterId);
    }
  }
});
origin: matrix-org/matrix-android-sdk

  @Override
  public void onSuccess(Void info) {
    Room room = getDataHandler().getRoom(fRoomId);
    if (null != room) {
      room.markAllAsRead(null);
    }
    if (null != callback) {
      callback.onSuccess(fRoomId);
    }
  }
});
origin: matrix-org/matrix-android-sdk

@Override
public void onSuccess(String roomId) {
  Log.d(LOG_TAG, "getConferenceUserRoom : the room creation succeeds");
  Room room = mSession.getDataHandler().getRoom(roomId);
  if (null != room) {
    room.setIsConferenceUserRoom(true);
    mSession.getDataHandler().getStore().commit();
    callback.onSuccess(room);
  }
}
origin: matrix-org/matrix-android-sdk

@Override
public void onSuccess(Void info) {
  Log.d(LOG_TAG, "## setURLPreviewStatus() : succeeds");
  getDataHandler().getStore().setURLPreviewEnabled(status);
  if (null != callback) {
    callback.onSuccess(null);
  }
}
origin: matrix-org/matrix-android-sdk

@Override
public void onSuccess(Void info) {
  Log.d(LOG_TAG, "## addUserWidget() : succeeds");
  getDataHandler().getStore().setUserWidgets(params);
  if (null != callback) {
    callback.onSuccess(null);
  }
}
origin: matrix-org/matrix-android-sdk

  @Override
  public void onLiveEvent(Event event, RoomState roomState) {
    if (TextUtils.equals(event.getType(), Event.EVENT_TYPE_MESSAGE) && !TextUtils.equals(event.getSender(), bobSession.getMyUserId())) {
      results.put("bobEcho", event);
      event.setClearData(null);
      bobSession.getDataHandler().decryptEvent(event, roomFromBobPOV.getTimeline().getTimelineId());
      results.put("decrypted", event);
      lock1.countDown();
    }
  }
};
origin: matrix-org/matrix-android-sdk

  private void checkAllName(RoomNameScenarioData roomNameScenarioData, String expectedName) {
    for (MXSession session : roomNameScenarioData.userSessions) {
      Assert.assertEquals(expectedName, session.getDataHandler().getRoom(roomNameScenarioData.roomId).getState().name);
    }
  }
}
origin: matrix-org/matrix-android-sdk

private void RoomSummary_CheckMembership(boolean withLazyLoading) throws Exception {
  final LazyLoadingScenarioData data = mLazyLoadingTestHelper.createScenario(withLazyLoading);
  mTestHelper.syncSession(data.aliceSession, false);
  final Room aliceRoom = data.aliceSession.getDataHandler().getRoom(data.roomId);
  final RoomSummary aliceRoomSummary = aliceRoom.getRoomSummary();
  Assert.assertNotNull(aliceRoomSummary);
  Assert.assertTrue(aliceRoomSummary.isJoined());
  mTestHelper.syncSession(data.samSession, false);
  final Room samRoom = data.samSession.getDataHandler().getRoom(data.roomId);
  final RoomSummary samRoomSummary = samRoom.getRoomSummary();
  Assert.assertNotNull(samRoomSummary);
  Assert.assertTrue(samRoomSummary.isJoined());
  mLazyLoadingTestHelper.clearAllSessions(data);
}
origin: matrix-org/matrix-android-sdk

private void RoomSummary_CheckRoomSummaryIsNullAfterLeavingFromAnotherDevice(boolean withLazyLoading) throws Exception {
  final LazyLoadingScenarioData data = mLazyLoadingTestHelper.createScenario(withLazyLoading);
  final CountDownLatch lock = new CountDownLatch(1);
  data.aliceSession.getDataHandler().getDataRetriever().getRoomsRestClient().leaveRoom(data.roomId, new TestApiCallback<Void>(lock));
  mTestHelper.await(lock);
  mTestHelper.syncSession(data.bobSession, false);
  final Room bobRoom = data.bobSession.getDataHandler().getRoom(data.roomId);
  mTestHelper.sendTextMessage(bobRoom, "New bob message", 50);
  mTestHelper.syncSession(data.aliceSession, false);
  final RoomSummary roomSummary = data.aliceSession.getDataHandler().getStore().getSummary(data.roomId);
  Assert.assertNull(roomSummary);
  mLazyLoadingTestHelper.clearAllSessions(data);
}
origin: matrix-org/matrix-android-sdk

private void RoomMembers_CheckAlreadyLoadedCount(final boolean withLazyLoading) throws Exception {
  final LazyLoadingScenarioData data = mLazyLoadingTestHelper.createScenario(withLazyLoading);
  mTestHelper.syncSession(data.aliceSession, false);
  final Room aliceRoom = data.aliceSession.getDataHandler().getRoom(data.roomId);
  final List<RoomMember> members = aliceRoom.getState().getLoadedMembers();
  if (withLazyLoading) {
    Assert.assertEquals(1, members.size());
  } else {
    Assert.assertEquals(4, members.size());
  }
  mLazyLoadingTestHelper.clearAllSessions(data);
}
origin: matrix-org/matrix-android-sdk

private void RoomMembers_CheckActiveCountAsync(final boolean withLazyLoading) throws Exception {
  final LazyLoadingScenarioData data = mLazyLoadingTestHelper.createScenario(withLazyLoading);
  mTestHelper.syncSession(data.aliceSession, false);
  final Room aliceRoom = data.aliceSession.getDataHandler().getRoom(data.roomId);
  final CountDownLatch lock = new CountDownLatch(1);
  aliceRoom.getActiveMembersAsync(new TestApiCallback<List<RoomMember>>(lock) {
    @Override
    public void onSuccess(List<RoomMember> roomMembers) {
      Assert.assertEquals(4, roomMembers.size());
      super.onSuccess(roomMembers);
    }
  });
  mTestHelper.await(lock);
  mLazyLoadingTestHelper.clearAllSessions(data);
}
origin: matrix-org/matrix-android-sdk

private void RoomState_InitialSync(final boolean withLazyLoading) throws Exception {
  final LazyLoadingScenarioData data = mLazyLoadingTestHelper.createScenario(withLazyLoading);
  mTestHelper.syncSession(data.aliceSession, false);
  final Room aliceRoom = data.aliceSession.getDataHandler().getRoom(data.roomId);
  if (withLazyLoading) {
    Assert.assertEquals(1, aliceRoom.getState().getLoadedMembers().size());
  } else {
    Assert.assertEquals(4, aliceRoom.getState().getLoadedMembers().size());
  }
  Assert.assertEquals(1, aliceRoom.getNumberOfInvitedMembers());
  Assert.assertEquals(3, aliceRoom.getNumberOfJoinedMembers());
  mLazyLoadingTestHelper.clearAllSessions(data);
}
org.matrix.androidsdkMXSessiongetDataHandler

Javadoc

Get the data handler.

Popular methods of MXSession

  • getMyUserId
    Get the session's current userid.
  • startEventStream
    Start the event stream (events thread that listens for events) with an event listener.
  • <init>
  • clear
    Clear the session data. if the callback is null, the clear is synchronous.
  • createRoom
    Create a new room with given properties.
  • enableCrypto
    Enable / disable the crypto.
  • getCredentials
    Get the user credentials.
  • getCrypto
  • getCryptoRestClient
  • getRoomsApiClient
    Get the API client for requests to the rooms API.
  • isCryptoEnabled
  • stopEventStream
    Gracefully stop the event stream.
  • isCryptoEnabled,
  • stopEventStream,
  • addDirectChatRoomToAccountData,
  • checkCrypto,
  • checkIfAlive,
  • clearApplicationCaches,
  • convertFilterToFilterId,
  • createDirectMessageRoom,
  • createRoomDirectMessage

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JComboBox (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now