noteCurrent method

void noteCurrent(
  1. String callId,
  2. bool inCall, {
  3. bool force = false,
})

句柄报告本设备是否在这个通话中:在 meta 的 calls.current 中保存或清除(force 时不比较内存中的值)。

Implementation

void noteCurrent(String callId, bool inCall, {bool force = false}) {
  if (_closing) return;
  if (inCall) {
    if (_savedCurrent == callId) return;
    _savedCurrent = callId;
    _saveCurrent(callId);
  } else {
    if (_savedCurrent != callId && !force) return;
    _savedCurrent = null;
    _saveCurrent(null);
  }
}