mergeIncomeNewMessages<T> abstract method

List<T> mergeIncomeNewMessages<T>({
  1. required List<T> messages,
  2. required bool isAddTop,
  3. required List<T> addedMsgs,
  4. required DateTime getMsgTime(
    1. T msg
  5. required bool isTimeTagMsg(
    1. T msg
  6. required T onCreateTimeTag(
    1. DateTime time
  7. required List<String> timeTagPolicies,
  8. required String getMsgId(
    1. T msg
  9. bool needRegenerateTimeTag = false,
  1. Add addedMsgs into messages and remove duplicated messages
  2. Generate time tag amount addedMsgs (keep time tag in messages not to change) if timeTagPolicies is "5m", "20m", "1h", "3h", is mean create a tag in 5min, 20min, 1hour and 3 hour, after that 3hours, create a time tag each 3 hours Notice, messsages and addedMsgs should be already ordered by time asc. It mean the function will not sort again


List<T> mergeIncomeNewMessages<T>(
    {required List<T> messages,
    required bool isAddTop,
    required List<T> addedMsgs,
    required DateTime Function(T msg) getMsgTime,
    required bool Function(T msg) isTimeTagMsg,
    required T Function(DateTime time) onCreateTimeTag,
    required List<String> timeTagPolicies,
    required String Function(T msg) getMsgId,
    bool needRegenerateTimeTag = false});