public override bool TakeAction() { int chatLeng = ConfigEnvSet.GetInt("Chat.ContentLeng"); if (_content.IndexOf("<label") >= 0) { chatLeng += 150; } GameUser toUser = new GameDataCacheSet<GameUser>().FindKey(_toUserID); if (toUser == null) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St9103_DoesNotExistTheUser; return false; } if (_content.Trim().Length == 0) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St9201_contentNotEmpty; return false; } if (_content.Length > chatLeng) { ErrorCode = LanguageManager.GetLang().ErrorCode; ErrorInfo = LanguageManager.GetLang().St9201_TheInputTextTooLong; return false; } //if (!CacheChat.IsAllow(ContextUser)) //{ // ErrorCode = LanguageManager.GetLang().ErrorCode; // ErrorInfo = LanguageManager.GetLang().St9203_ChatNotSend; // return false; //} var chatService = new TjxChatService(ContextUser); chatService.SendWhisper(toUser, _content); UserFriends friends = new ShareCacheStruct<UserFriends>().FindKey(ContextUser.UserID, _toUserID); if (friends != null) { friends.ChatTime = DateTime.Now; //friends.Update(); } return true; }