@Test public void processStateEvent_WhenNoStateKeyIsGiven__ShouldNotBeProcessed() { final Event event = new Event(); event.roomId = ROOM_ID; event.type = Event.EVENT_TYPE_STATE_ROOM_NAME; Assert.assertFalse(mTimelineStateHolder.processStateEvent(event, EventTimeline.Direction.FORWARDS, true)); }
public boolean processStateEvent(@NonNull final Event event, @NonNull final EventTimeline.Direction direction, final boolean considerNewContent) { final RoomState affectedState; final IMXStore store; if (direction == EventTimeline.Direction.FORWARDS) { affectedState = mState; store = mStore; } else { affectedState = mBackState; store = null; } final boolean isProcessed = affectedState.applyState(event, considerNewContent, store); if (isProcessed && direction == EventTimeline.Direction.FORWARDS) { mStore.storeLiveStateForRoom(mRoomId); } return isProcessed; }
TimelineStateHolder { public boolean processStateEvent(@NonNull final Event event, @NonNull final EventTimeline.Direction direction, final boolean considerNewContent) { final RoomState affectedState; final IMXStore store; if (direction == EventTimeline.Direction.FORWARDS) { affectedState = mState; store = mStore; } else { affectedState = mBackState; store = null; } final boolean isProcessed = affectedState.applyState(event, considerNewContent, store); if (isProcessed && direction == EventTimeline.Direction.FORWARDS) { mStore.storeLiveStateForRoom(mRoomId); } return isProcessed; } }
TimelineStateHolder { public boolean processStateEvent(@NonNull final Event event, @NonNull final EventTimeline.Direction direction, final boolean considerNewContent) { final RoomState affectedState; final IMXStore store; if (direction == EventTimeline.Direction.FORWARDS) { affectedState = mState; store = mStore; } else { affectedState = mBackState; store = null; } final boolean isProcessed = affectedState.applyState(event, considerNewContent, store); if (isProcessed && direction == EventTimeline.Direction.FORWARDS) { mStore.storeLiveStateForRoom(mRoomId); } return isProcessed; } TimelineStateHolder(@NonNull final MXDataHandler dataHandler,
                        @NonNull final IMXStore store,
                        @NonNull final String roomId); }
TimelineStateHolder { public boolean processStateEvent(@NonNull final Event event, @NonNull final EventTimeline.Direction direction, final boolean considerNewContent) { final RoomState affectedState; final IMXStore store; if (direction == EventTimeline.Direction.FORWARDS) { affectedState = mState; store = mStore; } else { affectedState = mBackState; store = null; } final boolean isProcessed = affectedState.applyState(event, considerNewContent, store); if (isProcessed && direction == EventTimeline.Direction.FORWARDS) { mStore.storeLiveStateForRoom(mRoomId); } return isProcessed; } TimelineStateHolder(@NonNull final MXDataHandler dataHandler,
                        @NonNull final IMXStore store,
                        @NonNull final String roomId); void clear(); @NonNull RoomState getState(); void setState(@NonNull final RoomState state); @NonNull RoomState getBackState(); void setBackState(@NonNull final RoomState state); void deepCopyState(final EventTimeline.Direction direction); boolean processStateEvent(@NonNull final Event event,
                                     @NonNull final EventTimeline.Direction direction,
                                     final boolean considerNewContent); void setRoomId(@NonNull final String roomId); }
TimelineStateHolder { public boolean processStateEvent(@NonNull final Event event, @NonNull final EventTimeline.Direction direction, final boolean considerNewContent) { final RoomState affectedState; final IMXStore store; if (direction == EventTimeline.Direction.FORWARDS) { affectedState = mState; store = mStore; } else { affectedState = mBackState; store = null; } final boolean isProcessed = affectedState.applyState(event, considerNewContent, store); if (isProcessed && direction == EventTimeline.Direction.FORWARDS) { mStore.storeLiveStateForRoom(mRoomId); } return isProcessed; } TimelineStateHolder(@NonNull final MXDataHandler dataHandler,
                        @NonNull final IMXStore store,
                        @NonNull final String roomId); void clear(); @NonNull RoomState getState(); void setState(@NonNull final RoomState state); @NonNull RoomState getBackState(); void setBackState(@NonNull final RoomState state); void deepCopyState(final EventTimeline.Direction direction); boolean processStateEvent(@NonNull final Event event,
                                     @NonNull final EventTimeline.Direction direction,
                                     final boolean considerNewContent); void setRoomId(@NonNull final String roomId);  }