buildInviteMemberNotification static method

Future<String> buildInviteMemberNotification(
  1. String tid,
  2. String fromAccId,
  3. NIMMessageNotificationAttachment attachment, {
  4. NIMTeam? team,
})

Implementation

static Future<String> buildInviteMemberNotification(
    String tid, String fromAccId, NIMMessageNotificationAttachment attachment,
    {NIMTeam? team}) async {
  var fromName = await getTeamMemberDisplayName(tid, fromAccId);
  var memberNames = await buildMemberListString(tid, attachment.targetIds!,
      fromAccount: fromAccId, needTeamNick: false);
  if (team == null) {
    team = (await NimCore.instance.teamService
            .getTeamInfo(tid, NIMTeamType.typeNormal))
        .data;
  }
  if (team != null && !getIt<TeamProvider>().isGroupTeam(team)) {
    return S.of().chatAdviceTeamNotifyInvite(fromName, memberNames);
  } else {
    return S.of().chatDiscussTeamNotifyInvite(fromName, memberNames);
  }
}