Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
|
-
- import 'package:chat/data/constants.dart';
- import 'package:chat/generated/i18n.dart';
-
- import 'package:oktoast/oktoast.dart';
-
- class BlacklistMgr {
- //我拉黑的用户id
- static Set<int> myBlacklistSet = new Set();
- //拉黑我的用户Id
- static Set<int> blacklistMeSet = new Set();
-
- //--------------------我的黑名单相关操作
- static addMyBlackList(int userId) {
- myBlacklistSet.add(userId);
- }
-
- static removeMyBalckList(int userId) {
- myBlacklistSet.remove(userId);
- }
-
- static bool isInMyblaklist(int userId) {
- return myBlacklistSet.contains(userId);
- }
-
- //------------------被拉黑名单相关操作
- static addBlackListMe(int userId) {
- blacklistMeSet.add(userId);
- }
-
- static removeBalckListMe(int userId) {
- blacklistMeSet.remove(userId);
- }
-
- static bool isBlaklistMe(int userId) {
- return blacklistMeSet.contains(userId);
- }
-
- //判断是否被别人拉黑或者拉黑别人
- static bool isBlack(int userId) {
- if (isBlaklistMe(userId)) {
- showToast(I18n.of(Constants.getCurrentContext()).you_are_blaklisted);
- return true;
- }
-
- if (BlacklistMgr.isInMyblaklist(userId)) {
- showToast(I18n.of(Constants.getCurrentContext()).reject_message);
- return true;
- }
- return false;
- }
- }
|