2020-05-10 12:45:19 +02:00
|
|
|
#include "util/Twitch.hpp"
|
|
|
|
|
|
|
|
#include <QDesktopServices>
|
2021-05-08 15:57:00 +02:00
|
|
|
#include <QUrl>
|
2020-05-10 12:45:19 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
void openTwitchUsercard(QString channel, QString username)
|
|
|
|
{
|
|
|
|
QDesktopServices::openUrl("https://www.twitch.tv/popout/" + channel +
|
|
|
|
"/viewercard/" + username);
|
|
|
|
}
|
2022-02-12 15:06:47 +01:00
|
|
|
|
|
|
|
void stripUserName(QString &userName)
|
|
|
|
{
|
|
|
|
if (userName.startsWith('@'))
|
|
|
|
{
|
|
|
|
userName.remove(0, 1);
|
|
|
|
}
|
|
|
|
if (userName.endsWith(','))
|
|
|
|
{
|
|
|
|
userName.chop(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void stripChannelName(QString &channelName)
|
|
|
|
{
|
|
|
|
if (channelName.startsWith('@') || channelName.startsWith('#'))
|
|
|
|
{
|
|
|
|
channelName.remove(0, 1);
|
|
|
|
}
|
|
|
|
if (channelName.endsWith(','))
|
|
|
|
{
|
|
|
|
channelName.chop(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-10 12:45:19 +02:00
|
|
|
} // namespace chatterino
|