removed functions from SettingsManager that shouldn't be there
This commit is contained in:
@@ -36,11 +36,11 @@ void BTTVEmotes::loadGlobalEmotes()
|
||||
QString code = emote.toObject().value("code").toString();
|
||||
|
||||
EmoteData emoteData;
|
||||
emoteData.image1x = new chatterino::Image(getEmoteLink(urlTemplate, id, "1x"), 1, code,
|
||||
emoteData.image1x = new Image(getEmoteLink(urlTemplate, id, "1x"), 1, code,
|
||||
code + "<br />Global BTTV Emote");
|
||||
emoteData.image2x = new chatterino::Image(getEmoteLink(urlTemplate, id, "2x"), 0.5,
|
||||
emoteData.image2x = new Image(getEmoteLink(urlTemplate, id, "2x"), 0.5,
|
||||
code, code + "<br />Global BTTV Emote");
|
||||
emoteData.image3x = new chatterino::Image(getEmoteLink(urlTemplate, id, "3x"), 0.25,
|
||||
emoteData.image3x = new Image(getEmoteLink(urlTemplate, id, "3x"), 0.25,
|
||||
code, code + "<br />Global BTTV Emote");
|
||||
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
|
||||
|
||||
@@ -90,17 +90,17 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptr<Emo
|
||||
QString link = linkTemplate;
|
||||
link.detach();
|
||||
emoteData.image1x =
|
||||
new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "1x"), 1,
|
||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "1x"), 1,
|
||||
code, code + "<br />Channel BTTV Emote");
|
||||
link = linkTemplate;
|
||||
link.detach();
|
||||
emoteData.image2x =
|
||||
new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "2x"),
|
||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "2x"),
|
||||
0.5, code, code + "<br />Channel BTTV Emote");
|
||||
link = linkTemplate;
|
||||
link.detach();
|
||||
emoteData.image3x =
|
||||
new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "3x"),
|
||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "3x"),
|
||||
0.25, code, code + "<br />Channel BTTV Emote");
|
||||
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ void Emojis::loadEmojiSet()
|
||||
urlPrefix = it->second;
|
||||
}
|
||||
QString url = urlPrefix + code + ".png";
|
||||
emoji->emoteData.image1x = new chatterino::Image(
|
||||
emoji->emoteData.image1x = new Image(
|
||||
url, 0.35, emoji->value, ":" + emoji->shortCodes[0] + ":<br/>Emoji");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -29,14 +29,14 @@ void fillInEmoteData(const QJsonObject &urls, const QString &code, const QString
|
||||
|
||||
assert(!url1x.isEmpty());
|
||||
|
||||
emoteData.image1x = new chatterino::Image(url1x, 1, code, tooltip);
|
||||
emoteData.image1x = new Image(url1x, 1, code, tooltip);
|
||||
|
||||
if (!url2x.isEmpty()) {
|
||||
emoteData.image2x = new chatterino::Image(url2x, 0.5, code, tooltip);
|
||||
emoteData.image2x = new Image(url2x, 0.5, code, tooltip);
|
||||
}
|
||||
|
||||
if (!url3x.isEmpty()) {
|
||||
emoteData.image3x = new chatterino::Image(url3x, 0.25, code, tooltip);
|
||||
emoteData.image3x = new Image(url3x, 0.25, code, tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ void IrcMessageHandler::addMessage(Communi::IrcMessage *_message, const QString
|
||||
return;
|
||||
}
|
||||
|
||||
chatterino::MessageParseArgs args;
|
||||
MessageParseArgs args;
|
||||
if (isSub) {
|
||||
args.trimSubscriberUsername = true;
|
||||
}
|
||||
@@ -58,13 +58,13 @@ void IrcMessageHandler::addMessage(Communi::IrcMessage *_message, const QString
|
||||
TwitchMessageBuilder builder(chan.get(), _message, args, content, isAction);
|
||||
|
||||
if (isSub || !builder.isIgnored()) {
|
||||
chatterino::MessagePtr msg = builder.build();
|
||||
MessagePtr msg = builder.build();
|
||||
|
||||
if (isSub) {
|
||||
msg->flags |= chatterino::Message::Subscription;
|
||||
msg->flags &= ~chatterino::Message::Highlighted;
|
||||
msg->flags |= Message::Subscription;
|
||||
msg->flags &= ~Message::Highlighted;
|
||||
} else {
|
||||
if (msg->flags & chatterino::Message::Highlighted) {
|
||||
if (msg->flags & Message::Highlighted) {
|
||||
server.mentionsChannel->addMessage(msg);
|
||||
getApp()->highlights->addHighlight(msg);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
|
||||
{
|
||||
auto app = getApp();
|
||||
Log("Received whisper!");
|
||||
chatterino::MessageParseArgs args;
|
||||
MessageParseArgs args;
|
||||
|
||||
args.isReceivedWhisper = true;
|
||||
|
||||
@@ -209,9 +209,9 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
|
||||
TwitchMessageBuilder builder(c, message, args, message->parameter(1), false);
|
||||
|
||||
if (!builder.isIgnored()) {
|
||||
chatterino::MessagePtr _message = builder.build();
|
||||
MessagePtr _message = builder.build();
|
||||
|
||||
if (_message->flags & chatterino::Message::Highlighted) {
|
||||
if (_message->flags & Message::Highlighted) {
|
||||
app->twitch.server->mentionsChannel->addMessage(_message);
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message)
|
||||
|
||||
c->addMessage(_message);
|
||||
|
||||
_message->flags |= chatterino::Message::DoNotTriggerNotification;
|
||||
_message->flags |= Message::DoNotTriggerNotification;
|
||||
|
||||
if (app->settings->inlineWhispers) {
|
||||
app->twitch.server->forEachChannel([_message](ChannelPtr channel) {
|
||||
@@ -254,9 +254,9 @@ void IrcMessageHandler::handleUserNoticeMessage(Communi::IrcMessage *message, Tw
|
||||
|
||||
if (it != tags.end()) {
|
||||
auto newMessage =
|
||||
chatterino::Message::createSystemMessage(parseTagString(it.value().toString()));
|
||||
Message::createSystemMessage(parseTagString(it.value().toString()));
|
||||
|
||||
newMessage->flags |= chatterino::Message::Subscription;
|
||||
newMessage->flags |= Message::Subscription;
|
||||
|
||||
QString channelName;
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ private:
|
||||
std::shared_ptr<TwitchAccount> anonymousUser;
|
||||
mutable std::mutex mutex;
|
||||
|
||||
friend class chatterino::AccountController;
|
||||
friend class AccountController;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -95,7 +95,7 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection
|
||||
|
||||
#if 0
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
this->addMessage(chatterino::Message::createSystemMessage("asdf"));
|
||||
this->addMessage(Message::createSystemMessage("asdf"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void TwitchChannel::sendMessage(const QString &message)
|
||||
// XXX: It would be nice if we could add a link here somehow that opened the "account
|
||||
// manager" dialog
|
||||
this->addMessage(
|
||||
chatterino::Message::createSystemMessage("You need to log in to send messages. You can "
|
||||
Message::createSystemMessage("You need to log in to send messages. You can "
|
||||
"link your Twitch account in the settings."));
|
||||
return;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ bool TwitchChannel::hasModRights()
|
||||
return this->isMod() || this->isBroadcaster();
|
||||
}
|
||||
|
||||
void TwitchChannel::addRecentChatter(const std::shared_ptr<chatterino::Message> &message)
|
||||
void TwitchChannel::addRecentChatter(const std::shared_ptr<Message> &message)
|
||||
{
|
||||
assert(!message->loginName.isEmpty());
|
||||
|
||||
@@ -233,9 +233,9 @@ void TwitchChannel::addJoinedUser(const QString &user)
|
||||
QTimer::singleShot(500, &this->object, [this] {
|
||||
std::lock_guard<std::mutex> guard(this->joinedUserMutex);
|
||||
|
||||
auto message = chatterino::Message::createSystemMessage("Users joined: " +
|
||||
auto message = Message::createSystemMessage("Users joined: " +
|
||||
this->joinedUsers.join(", "));
|
||||
message->flags |= chatterino::Message::Collapsed;
|
||||
message->flags |= Message::Collapsed;
|
||||
this->addMessage(message);
|
||||
this->joinedUsers.clear();
|
||||
this->joinedUsersMergeQueued = false;
|
||||
@@ -262,9 +262,9 @@ void TwitchChannel::addPartedUser(const QString &user)
|
||||
QTimer::singleShot(500, &this->object, [this] {
|
||||
std::lock_guard<std::mutex> guard(this->partedUserMutex);
|
||||
|
||||
auto message = chatterino::Message::createSystemMessage("Users parted: " +
|
||||
auto message = Message::createSystemMessage("Users parted: " +
|
||||
this->partedUsers.join(", "));
|
||||
message->flags |= chatterino::Message::Collapsed;
|
||||
message->flags |= Message::Collapsed;
|
||||
this->addMessage(message);
|
||||
this->partedUsers.clear();
|
||||
|
||||
@@ -449,14 +449,14 @@ void TwitchChannel::fetchRecentMessages()
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<chatterino::MessagePtr> messages;
|
||||
std::vector<MessagePtr> messages;
|
||||
|
||||
for (const QJsonValueRef _msg : msgArray) {
|
||||
QByteArray content = _msg.toString().toUtf8();
|
||||
auto msg = Communi::IrcMessage::fromData(content, readConnection);
|
||||
auto privMsg = static_cast<Communi::IrcPrivateMessage *>(msg);
|
||||
|
||||
chatterino::MessageParseArgs args;
|
||||
MessageParseArgs args;
|
||||
TwitchMessageBuilder builder(channel, privMsg, args);
|
||||
if (!builder.isIgnored()) {
|
||||
messages.push_back(builder.build());
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
bool isBroadcaster() const override;
|
||||
bool hasModRights();
|
||||
|
||||
void addRecentChatter(const std::shared_ptr<chatterino::Message> &message) final;
|
||||
void addRecentChatter(const std::shared_ptr<Message> &message) final;
|
||||
void addJoinedUser(const QString &user);
|
||||
void addPartedUser(const QString &user);
|
||||
|
||||
|
||||
@@ -123,15 +123,15 @@ EmoteData TwitchEmotes::getEmoteById(const QString &id, const QString &emoteName
|
||||
return _twitchEmoteFromCache.getOrAdd(id, [&emoteName, &_emoteName, &id] {
|
||||
EmoteData newEmoteData;
|
||||
auto cleanCode = cleanUpCode(emoteName);
|
||||
newEmoteData.image1x = new chatterino::Image(getEmoteLink(id, "1.0"), 1, emoteName,
|
||||
newEmoteData.image1x = new Image(getEmoteLink(id, "1.0"), 1, emoteName,
|
||||
_emoteName + "<br/>Twitch Emote 1x");
|
||||
newEmoteData.image1x->setCopyString(cleanCode);
|
||||
|
||||
newEmoteData.image2x = new chatterino::Image(getEmoteLink(id, "2.0"), .5, emoteName,
|
||||
newEmoteData.image2x = new Image(getEmoteLink(id, "2.0"), .5, emoteName,
|
||||
_emoteName + "<br/>Twitch Emote 2x");
|
||||
newEmoteData.image2x->setCopyString(cleanCode);
|
||||
|
||||
newEmoteData.image3x = new chatterino::Image(getEmoteLink(id, "3.0"), .25, emoteName,
|
||||
newEmoteData.image3x = new Image(getEmoteLink(id, "3.0"), .25, emoteName,
|
||||
_emoteName + "<br/>Twitch Emote 3x");
|
||||
|
||||
newEmoteData.image3x->setCopyString(cleanCode);
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace chatterino {
|
||||
|
||||
TwitchMessageBuilder::TwitchMessageBuilder(Channel *_channel,
|
||||
const Communi::IrcPrivateMessage *_ircMessage,
|
||||
const chatterino::MessageParseArgs &_args)
|
||||
const MessageParseArgs &_args)
|
||||
: channel(_channel)
|
||||
, twitchChannel(dynamic_cast<TwitchChannel *>(_channel))
|
||||
, ircMessage(_ircMessage)
|
||||
@@ -37,7 +37,7 @@ TwitchMessageBuilder::TwitchMessageBuilder(Channel *_channel,
|
||||
|
||||
TwitchMessageBuilder::TwitchMessageBuilder(Channel *_channel,
|
||||
const Communi::IrcMessage *_ircMessage,
|
||||
const chatterino::MessageParseArgs &_args,
|
||||
const MessageParseArgs &_args,
|
||||
QString content, bool isAction)
|
||||
: channel(_channel)
|
||||
, twitchChannel(dynamic_cast<TwitchChannel *>(_channel))
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace chatterino {
|
||||
class Channel;
|
||||
class TwitchChannel;
|
||||
|
||||
class TwitchMessageBuilder : public chatterino::MessageBuilder
|
||||
class TwitchMessageBuilder : public MessageBuilder
|
||||
{
|
||||
public:
|
||||
enum UsernameDisplayMode : int {
|
||||
@@ -26,22 +26,22 @@ public:
|
||||
TwitchMessageBuilder() = delete;
|
||||
|
||||
explicit TwitchMessageBuilder(Channel *_channel, const Communi::IrcPrivateMessage *_ircMessage,
|
||||
const chatterino::MessageParseArgs &_args);
|
||||
const MessageParseArgs &_args);
|
||||
explicit TwitchMessageBuilder(Channel *_channel, const Communi::IrcMessage *_ircMessage,
|
||||
const chatterino::MessageParseArgs &_args, QString content,
|
||||
const MessageParseArgs &_args, QString content,
|
||||
bool isAction);
|
||||
|
||||
Channel *channel;
|
||||
TwitchChannel *twitchChannel;
|
||||
const Communi::IrcMessage *ircMessage;
|
||||
chatterino::MessageParseArgs args;
|
||||
MessageParseArgs args;
|
||||
const QVariantMap tags;
|
||||
|
||||
QString messageID;
|
||||
QString userName;
|
||||
|
||||
bool isIgnored() const;
|
||||
chatterino::MessagePtr build();
|
||||
MessagePtr build();
|
||||
|
||||
private:
|
||||
QString roomID;
|
||||
|
||||
@@ -195,7 +195,7 @@ void TwitchServer::onMessageSendRequested(TwitchChannel *channel, const QString
|
||||
if (!lastMessage.empty() && lastMessage.back() + minMessageOffset > now) {
|
||||
if (this->lastErrorTimeSpeed_ + 30s < now) {
|
||||
auto errorMessage =
|
||||
chatterino::Message::createSystemMessage("sending messages too fast");
|
||||
Message::createSystemMessage("sending messages too fast");
|
||||
|
||||
channel->addMessage(errorMessage);
|
||||
|
||||
@@ -213,7 +213,7 @@ void TwitchServer::onMessageSendRequested(TwitchChannel *channel, const QString
|
||||
if (lastMessage.size() >= maxMessageCount) {
|
||||
if (this->lastErrorTimeAmount_ + 30s < now) {
|
||||
auto errorMessage =
|
||||
chatterino::Message::createSystemMessage("sending too many messages");
|
||||
Message::createSystemMessage("sending too many messages");
|
||||
|
||||
channel->addMessage(errorMessage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user