com.zulip.android.ZulipApp.setMaxMessageId()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(63)

本文整理了Java中com.zulip.android.ZulipApp.setMaxMessageId()方法的一些代码示例,展示了ZulipApp.setMaxMessageId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZulipApp.setMaxMessageId()方法的具体详情如下:
包路径:com.zulip.android.ZulipApp
类名称:ZulipApp
方法名:setMaxMessageId

ZulipApp.setMaxMessageId介绍

暂无

代码示例

代码示例来源:origin: zulip/zulip-android

public void onResetDatabase() {
  setPointer(-1);
  setMaxMessageId(-1);
  setLastEventId(-1);
  setEventQueueId(null);
}

代码示例来源:origin: zulip/zulip-android

public void testUpdateMessageRange() throws SQLException {
  prepTests();
  app.setMaxMessageId(1000);
  MessageRange.updateNewMessagesRange(app, 1010);
  checkRanges("(1000,1010)");
  MessageRange.updateNewMessagesRange(app, 1020);
  checkRanges("(1000,1020)");
  // Then, after we skip some messages...
  app.setMaxMessageId(2000);
  MessageRange.updateNewMessagesRange(app, 2010);
  checkRanges("(1000,1020)(2000,2010)");
}

代码示例来源:origin: zulip/zulip-android

public static void updateNewMessagesRange(ZulipApp app, int maxId) {
  synchronized (app.updateRangeLock) {
    RuntimeExceptionDao<MessageRange, Integer> rangeDao = app
        .getDao(MessageRange.class);
    MessageRange currentRange = MessageRange.getRangeContaining(
        app.getMaxMessageId(), rangeDao);
    if (currentRange == null) {
      currentRange = new MessageRange(app.getMaxMessageId(),
          app.getMaxMessageId());
    }
    if (currentRange.high <= maxId) {
      currentRange.high = maxId;
      rangeDao.createOrUpdate(currentRange);
    }
  }
  app.setMaxMessageId(maxId);
}

代码示例来源:origin: zulip/zulip-android

/**
 * Registers for a new event queue with the Zulip API
 */
private void register() throws JSONException, IOException {
  retrofit2.Response<UserConfigurationResponse> response = app.getZulipServices()
      .register(true)
      .execute();
  if (response.isSuccessful()) {
    UserConfigurationResponse res = response.body();
    app.tester = app.getEventQueueId();
    app.setEventQueueId(res.getQueueId());
    app.setLastEventId(res.getLastEventId());
    app.setPointer(res.getPointer());
    app.setMaxMessageId(res.getMaxMessageId());
    app.setMessageContentEditParams(res.getRealmMessageContentEditLimitSeconds(),
        res.isRealmAllowMessageEditing());
    registeredOrGotEventsThisRun = true;
    processRegister(res);
  }
}

相关文章