formatNotification method
Implementation
@override
Future<String> formatNotification(Message message) async {
if (quitMember == await FlutterImclient.currentUserId) {
return '你 退出了群组';
} else {
UserInfo? userInfo =
await FlutterImclient.getUserInfo(quitMember, groupId: groupId);
if (userInfo != null) {
if (userInfo.friendAlias != null && userInfo.friendAlias!.isNotEmpty) {
return '${userInfo.friendAlias} 退出了群组';
} else if (userInfo.groupAlias != null &&
userInfo.groupAlias!.isNotEmpty) {
return '${userInfo.groupAlias} 退出了群组';
} else if (userInfo.displayName != null &&
userInfo.displayName!.isNotEmpty) {
return '${userInfo.displayName} 退出了群组';
} else {
return '$quitMember 退出了群组';
}
} else {
return '$quitMember 退出了群组';
}
}
}