diff --git a/src/actionsmodel.cpp b/src/actionsmodel.cpp index 3070a2454..22425145e 100644 --- a/src/actionsmodel.cpp +++ b/src/actionsmodel.cpp @@ -281,6 +281,36 @@ QVector actions{ kli18n("[]"), kli18n("Leaves the given room or this room, if there is none given"), }, + Action{ + QStringLiteral("nick"), + [](const QString &text, NeoChatRoom *room) { + if (text.isEmpty()) { + Q_EMIT room->showMessage(NeoChatRoom::Error, i18n("No new nickname provided, no changes will happen.")); + } else { + room->connection()->user()->rename(text); + } + return QString(); + }, + false, + std::nullopt, + kli18n(""), + kli18n("Changes your global display name"), + }, + Action{ + QStringLiteral("roomnick"), + [](const QString &text, NeoChatRoom *room) { + if (text.isEmpty()) { + Q_EMIT room->showMessage(NeoChatRoom::Error, i18n("No new nickname provided, no changes will happen.")); + } else { + room->connection()->user()->rename(text, room); + } + return QString(); + }, + false, + std::nullopt, + kli18n(""), + kli18n("Changes your display name in this room"), + }, Action{ QStringLiteral("ignore"), [](const QString &text, NeoChatRoom *room) {