Initial backend test for user-based data/customizations (#4144)
Right now only support for colors and no real UX, idea is to test it & allow the idea to grow while figuring out the UX
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#include "controllers/highlights/HighlightController.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "BaseSettings.hpp"
|
||||
#include "messages/MessageBuilder.hpp" // for MessageParseArgs
|
||||
#include "messages/MessageBuilder.hpp" // for MessageParseArgs
|
||||
#include "mocks/UserData.hpp"
|
||||
#include "providers/twitch/TwitchBadge.hpp" // for Badge
|
||||
#include "providers/twitch/api/Helix.hpp"
|
||||
|
||||
@@ -73,9 +75,14 @@ public:
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
IUserDataController *getUserData() override
|
||||
{
|
||||
return &this->userData;
|
||||
}
|
||||
|
||||
AccountController accounts;
|
||||
HighlightController highlights;
|
||||
mock::UserDataController userData;
|
||||
// TODO: Figure this out
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Application.hpp"
|
||||
#include "common/Channel.hpp"
|
||||
#include "messages/MessageBuilder.hpp"
|
||||
#include "mocks/UserData.hpp"
|
||||
#include "providers/twitch/TwitchBadge.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
|
||||
@@ -73,8 +74,13 @@ public:
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
IUserDataController *getUserData() override
|
||||
{
|
||||
return &this->userData;
|
||||
}
|
||||
|
||||
Emotes emotes;
|
||||
mock::UserDataController userData;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "controllers/userdata/UserDataController.hpp"
|
||||
|
||||
namespace chatterino::mock {
|
||||
|
||||
class UserDataController : public IUserDataController
|
||||
{
|
||||
public:
|
||||
UserDataController() = default;
|
||||
|
||||
// Get extra data about a user
|
||||
// If the user does not have any extra data, return none
|
||||
boost::optional<UserData> getUser(const QString &userID) const override
|
||||
{
|
||||
return boost::none;
|
||||
}
|
||||
|
||||
// Update or insert extra data for the user's color override
|
||||
void setUserColor(const QString &userID,
|
||||
const QString &colorString) override
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace chatterino::mock
|
||||
Reference in New Issue
Block a user