buildInviteMemberNotification static method

Future<String> buildInviteMemberNotification(
  1. String tid,
  2. String fromAccId,
  3. NIMMessageNotificationAttachment attachment
)

Implementation

static Future<String> buildInviteMemberNotification(String tid,
    String fromAccId, NIMMessageNotificationAttachment attachment) async {
  var fromName = await getTeamMemberDisplayName(tid, fromAccId);
  var memberNames = await buildMemberListString(tid, attachment.targetIds!,
      fromAccount: fromAccId, needTeamNick: false);
  var 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);
  }
}