Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: also support myroomnick to change roomnick #1349

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion man/nheko.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Redacts all visible messages of the specified user. You will run into rate limit
*/redact* _<eventid>_ _[reason]_::
Redacts a specific event.

*/roomnick* _<roomname>_::
*/myroomnick*, */roomnick* _<roomname>_::
Change your nickname in a single room.

=== Emoticons
Expand Down
4 changes: 4 additions & 0 deletions src/CommandCompleter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ CommandCompleter::data(const QModelIndex &index, int role) const
return QStringLiteral("/unban @");
case Redact:
return QStringLiteral("/redact ");
case MyRoomnick:
BLumia marked this conversation as resolved.
Show resolved Hide resolved
return QStringLiteral("/myroomnick ");
case Roomnick:
return QStringLiteral("/roomnick ");
case Shrug:
Expand Down Expand Up @@ -124,6 +126,8 @@ CommandCompleter::data(const QModelIndex &index, int role) const
return tr("/unban <@userid> [reason]");
case Redact:
return tr("/redact <$eventid|@userid>");
case MyRoomnick:
return tr("/myroomnick <displayname>");
case Roomnick:
return tr("/roomnick <displayname>");
case Shrug:
Expand Down
1 change: 1 addition & 0 deletions src/CommandCompleter.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class CommandCompleter final : public QAbstractListModel
Ban,
Unban,
Redact,
MyRoomnick,
Roomnick,
Shrug,
Fliptable,
Expand Down
2 changes: 1 addition & 1 deletion src/timeline/InputBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ InputBar::command(const QString &command, QString args)
} else if (args.startsWith('$')) {
room->redactEvent(args.section(' ', 0, 0), args.section(' ', 1, -1));
}
} else if (command == QLatin1String("roomnick")) {
} else if (command == QLatin1String("myroomnick") || command == QLatin1String("roomnick")) {
mtx::events::state::Member member;
member.display_name = args.toStdString();
member.avatar_url =
Expand Down