code: protected long getChatExpire (long timestamp, String text)
      {
          long[] durations = _logic.getDisplayDurations(getDisplayDurationOffset());
          // start the computation from the maximum of the timestamp or our last expire time
          long start = Math.max(timestamp, _lastExpire);
          // set the next expire to a time proportional to the text length
          _lastExpire = start + Math.min(text.length() * durations[0], durations[2]);
          // but don't let it be longer than the maximum display time
          _lastExpire = Math.min(timestamp + durations[2], _lastExpire);
          // and be sure to pop up the returned time so that it is above the min
          return Math.max(timestamp + durations[1], _lastExpire);
      }
docs: Get the expire time for the specified chat.