Make a command that shows the Chatterino user card (/usercard) (#1375)
* Make UserInfoPopup be able to show that fetching the information failed.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "util/CombinePath.hpp"
|
||||
#include "widgets/dialogs/LogsPopup.hpp"
|
||||
#include "widgets/dialogs/UserInfoPopup.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFile>
|
||||
@@ -481,6 +482,21 @@ QString CommandController::execCommand(const QString &textNoEmoji,
|
||||
channelName + "/viewercard/" + words[1]);
|
||||
return "";
|
||||
}
|
||||
else if (commandName == "/usercard")
|
||||
{
|
||||
if (words.size() < 2)
|
||||
{
|
||||
channel->addMessage(
|
||||
makeSystemMessage("Usage /usercard [user]"));
|
||||
return "";
|
||||
}
|
||||
auto *userPopup = new UserInfoPopup;
|
||||
userPopup->setData(words[1], channel);
|
||||
userPopup->setActionOnFocusLoss(BaseWindow::Delete);
|
||||
userPopup->move(QCursor::pos());
|
||||
userPopup->show();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user