SetTalker static method

void SetTalker(
  1. dynamic params
)

long userId,long groupId, String userName, boolean hideTalker

Implementation

//有人讲话:[[328140], 257550, zdh, false]
//没人讲话:[[4294967295], 4294967295, null, false]
//登陆后立即回调一次:[4294967295, 4294967295, null, false]
//注销后立即回调一次:[4294967295, 4294967295, null, true]
static void SetTalker(dynamic params) {
  Log.i(tag, "SetTalker:$params");
  Log.i(tag,
      "SetTalker params:${params[0]},${params[1]},${params[2]},${params[3]}");
  List<int> idList = List<int>.from(params[0]);
  Log.i(tag, "SetTalker:idList:$idList");
  //4294967295或0表示没人讲话
  if (idList.length == 1 && (idList[0] == 0 || idList[0] == 4294967295)) {
    idList = [];
  }
  //没人讲话时
  if (params[2] == null) {
    params[2] = "";
  }

  //更新用户讲话数据(讲话状态,收发类型,讲话人名称)
  Log.i(tag, "SetTalker:setSpeaking");
  pocChangeNotifier.setSpeaking(idList, params[2], params[3]);
  if (idList.isEmpty) {
    //没人讲话
    Log.i(tag, "SetTalker:没人讲话");
    ToastUtils.instance.hiddenSpeaker();
  } else {
    //有人讲话
    Log.i(tag, "SetTalker:有人讲话");
    ToastUtils.instance.showSpeaker(getSpeakingText());
  }
}