make channel scopes configurable - #68
Conversation
fdlamotte
left a comment
There was a problem hiding this comment.
Interesting ...
I didn't want to implement this because this mapping is not stored on the device, but if there is some interest, and noone is forced to use it, that's good for me
Note that with this implentation, the scope will only be applied in interactive mode when using to, this is not a bad thing (and is in my opinion better) but users should be aware of that
Also, I would give priority to the scope set with % (for that just use elif on l1248)
I'm not sure about the behavior that should be taken when going back to root ... maybe set scope to "" only if current scope corresponds to the one in the dict for the channel we are living ? The user might want to keep is scope while changing destination (would not go further as it would mean using some stack of context and I'd like to let the mechanism as simple as possible)
why doesn't it work when |
6ab1305 to
7944709
Compare
|
Tried different approach. My scopes: With Without With this approach now prompt shows default scope when set. Not sure what to think about restart requirement after setting it. If it's documented behavior, then it's easier, otherwise bit more complex handling must be added. How does this look? I'd deal with documentation and such after code is finished. |
|
Hi I don't want the prompt to show default scope when set ;) that was on purpose ... The scope on the prompt is the overriden one When no scope name is shown user knows he is on default scope ... If he doesn't remind what it is, then he calls just found some issues with parsing (' and " split lines in chat mode !) so I'll probably include your proposal in 1.6.1 ;) |
|
I'm sorry, as I have the impression we are regressing ... Your first try was good, and default scope was treated as it should (this is already taken care of actually) The only thing that I wanted was to give priority to If you want, you can revert to the first version and I'll take care of the changes myself ;) |
|
the simplest the better ;) thank you ! |
|
Alright, I restored initial state, mostly. I tried to solve switching between channels with and without defined scope. Now switching to channel without defined scope will inherit whatever was set for channel with scope. Also switching to root requires special treatment. Of course I can define scopes for all my channels, not only those I want to override from default, and that solves it. |
|
I've implemented it the way I wanted ... if we leave a channel and the scope had been obtained from scopes file, then reset scope (if no new scope was resolved) ... |

This is a quick hack to add per channel scope configuration and I'm probably doing it wrong.
Currently this only works when
default_scopeis not set.Configuration file is straightforward and must be edited manually:
I wish to have similar behavior as with mobile/web app where I can override default scope per channel, even if default scope is set (in experimental settings).
Happy to hear feedback from maintainer(s) and even more happier if anyone else implements this feature as they see fit. Thanks!