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
Matrix client improvements #149
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #149 +/- ##
==========================================
+ Coverage 40.57% 40.62% +0.04%
==========================================
Files 243 244 +1
Lines 19215 19393 +178
==========================================
+ Hits 7797 7878 +81
- Misses 11418 11515 +97
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from some small problems, all is good!
apps/matrix/main.py
Outdated
Menu(mc, self.i, self.o, catch_exit=False, name="Matrix app settings menu").activate() | ||
mc = [ | ||
["Log out", self.logout], | ||
["Hide join/leave messages", lambda: self._change_setting("show_join_leave_messages", False)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, re-do this to toggle the setting instead (use contents_hook
for autogenerating the correct label), so that there's only one entry instead of two - and it also shows the status
apps/matrix/main.py
Outdated
@@ -230,7 +273,11 @@ def _on_message(self, room, event): | |||
prefix = "" | |||
if event.get('sender', None) == self.client.get_user().user_id or event.get("sender", None) in self.config["your_other_usernames"]: | |||
# Prefix own messages with a '*' | |||
prefix = "* " | |||
prefix = "[*] " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you want to add two more characters? We don't have too many of them on the screen =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was wondering about this as well, I'll change it back to one =)
apps/matrix/main.py
Outdated
|
||
def gen_menu_contents(): | ||
mc = [["Log out", self.logout]] | ||
mc.append(["Hide join/leave messages", lambda: self._change_setting("show_join_leave_messages", False)] if self.config["show_join_leave_messages"] else ["Show join/leave messages", lambda: self._change_setting("show_join_leave_messages", True)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line is too long, we can shorten it like this:
mc.append(["Hide join/leave messages", lambda: self._change_setting("show_join_leave_messages", False)] if self.config["show_join_leave_messages"] else ["Show join/leave messages", lambda: self._change_setting("show_join_leave_messages", True)]) | |
conf_key = "show_join_leave_messages" | |
mc.append([ "Hide join/leave messages", \ | |
lambda: self._change_setting(conf_key, False) ] \ | |
if self.config[conf_key] else [ "Show join/leave messages", \ | |
lambda: self._change_setting(conf_key, True) ]) |
Do test that it works after merging if you can, please =)
Thank you! |
This PR adds a few things to the matrix client: