Skip to content

Commit

Permalink
feat: also support myroomnick to change roomnick
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia committed Feb 3, 2023
1 parent 0ab566d commit 91f1c56
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
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
2 changes: 2 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 QString("/unban @");
case Redact:
return QString("/redact ");
case MyRoomnick:
return QString("/myroomnick ");
case Roomnick:
return QString("/roomnick ");
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

0 comments on commit 91f1c56

Please sign in to comment.