-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Improve window title behaviour #1881
Conversation
Thanks that looks good! I only think we might need to describe this somewhere to the user. What will be used as the MUC name. Specifically |
Good point. It looks like /roster and /statusbar let the user choose between displaying the room name or jid. /roster room use name|jid Maybe /titlebar should behave the same way. What do you think about replacing "/titlebar show|hide name|jid" with "/titlebar title bookmark|name|jid"? The user will not be able to hide the window title anymore, but /titlebar will behave like /roster and /statusbar instead. Bookmark name should be an option in /roster and /statusbar too. |
That sounds good. |
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.
As mentioned in the comments. Just using this so that I know that I reviewed this PR and don't check it again until required :)
src/ui/mucwin.c
Outdated
mucwin_set_title(const char* const room_jid, const char* const disco_name) | ||
{ | ||
ProfMucWin* win = wins_get_muc(room_jid); | ||
if (win) { |
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.
Maybe just write error in log and return FALSE if !win? It would be more flexible approach
@ike08 ping :) |
@ike08 could you post here a small summary why you closed the PR? For future reference :) |
I needed to sync my fork to master before committing new changes. I didn't know GitHub would close my PR when I clicked the sync button. I will reference this PR in my next PR. |
I see! It's best to always work on a branch other than master. |
Can you explain why? I'm not trying to be contentious; I'm new to Git and it is not obvious to me. My new code will need to be merged, so it makes sense to add the new code to the most recent version of master to reduce merging conflicts. |
Sure, I'll try :) Usually I do: Now I go to work on In the meantime jaeckel codes on his cool feature. Creates a PR. It gets merged upstream. So now I can easily do If I code on master directly then I will have merge conflicts and diverging branches locally vs upstream. |
Brilliant. That is much better than what I was trying to do. Thank you |
You can use E.g. we are on the feature branch and we want to merge our branch with master, then we do git checkout master # getting to the master branch so we can pull updates for it
git pull # pulling the updates that Jaeckel pushed, hence updating our local master branch
git checkout - # now we get back to our feature branch
git rebase master # now we are rebasing on the master branch, so we can get our branch updated locally
git push --force-with-lease # pushing the update in a somewhat safe manner to update its remote part (on Github in this case) And if you have some changes that you haven't yet applied (and don't want to apply yet), you can use |
Cleanup the window title code by adding a function to mucwin.c that properly sets the window title. Remove window title code from iq.c and message.c and add calls to the new window title function. Below are three goals accomplished.
New feature: Display bookmark name as the window title.
Bug Fix 1: Profanity segfaults if a Room Name is NULL after re-retrieving the MUC's Disco information. Eg, after using "/room config" and "/form submit" when Room Name is blank.
Bug fix 2: MUC windows show an empty window title when joining a room that has a NULL Room Name.
HOW TO TEST message.c
HOW TO TEST iq.c
I ran valgrind.