Merge pull request #652 from DarkflameUniverse/blacklist-and-chat-changes

Blacklist and chat changes
This commit is contained in:
Jett
2022-07-19 10:40:44 +01:00
committed by GitHub
10 changed files with 147 additions and 63 deletions

View File

@@ -18,6 +18,8 @@ User::User(const SystemAddress& sysAddr, const std::string& username, const std:
m_SystemAddress = sysAddr;
m_Username = username;
m_LoggedInCharID = 0;
m_IsBestFriendMap = std::unordered_map<std::string, bool>();
//HACK HACK HACK
//This needs to be re-enabled / updated whenever the mute stuff is moved to another table.

View File

@@ -42,6 +42,9 @@ public:
bool GetLastChatMessageApproved() { return m_LastChatMessageApproved; }
void SetLastChatMessageApproved(bool approved) { m_LastChatMessageApproved = approved; }
std::unordered_map<std::string, bool> GetIsBestFriendMap() { return m_IsBestFriendMap; }
void SetIsBestFriendMap(std::unordered_map<std::string, bool> mapToSet) { m_IsBestFriendMap = mapToSet; }
bool GetIsMuted() const;
time_t GetMuteExpire() const;
@@ -63,6 +66,8 @@ private:
std::vector<Character*> m_Characters;
LWOOBJID m_LoggedInCharID;
std::unordered_map<std::string, bool> m_IsBestFriendMap;
bool m_LastChatMessageApproved = false;
int m_AmountOfTimesOutOfSync = 0;
const int m_MaxDesyncAllowed = 12;

View File

@@ -1193,7 +1193,7 @@ void PetComponent::SetPetNameForModeration(const std::string& petName) {
int approved = 1; //default, in mod
//Make sure that the name isn't already auto-approved:
if (Game::chatFilter->IsSentenceOkay(petName, 0)) {
if (Game::chatFilter->IsSentenceOkay(petName, 0).empty()) {
approved = 2; //approved
}