2016-01-21 20:24:02 -05:00
|
|
|
[colours]
|
|
|
|
bkgnd=default
|
|
|
|
titlebar=blue
|
|
|
|
titlebar.text=bold_white
|
|
|
|
titlebar.brackets=bold_white
|
|
|
|
titlebar.unencrypted=bold_red
|
|
|
|
titlebar.encrypted=bold_white
|
|
|
|
titlebar.untrusted=bold_yellow
|
|
|
|
titlebar.trusted=bold_white
|
|
|
|
titlebar.online=bold_green
|
|
|
|
titlebar.offline=bold_red
|
|
|
|
titlebar.away=bold_cyan
|
|
|
|
titlebar.xa=bold_cyan
|
|
|
|
titlebar.dnd=bold_red
|
|
|
|
titlebar.chat=bold_green
|
|
|
|
statusbar=blue
|
|
|
|
statusbar.text=bold_white
|
2019-06-05 04:40:03 -04:00
|
|
|
statusbar.time=bold_white
|
2016-01-21 20:24:02 -05:00
|
|
|
statusbar.brackets=bold_white
|
|
|
|
statusbar.active=bold_cyan
|
|
|
|
statusbar.new=bold_white
|
|
|
|
main.text=white
|
|
|
|
main.text.me=cyan
|
|
|
|
main.text.them=bold_white
|
|
|
|
main.splash=bold_red
|
2016-10-30 13:06:06 -04:00
|
|
|
main.help.header=bold_white
|
2016-01-21 20:24:02 -05:00
|
|
|
main.time=yellow
|
|
|
|
input.text=bold_green
|
2016-01-31 20:42:09 -05:00
|
|
|
subscribed=green
|
2016-01-21 20:24:02 -05:00
|
|
|
unsubscribed=red
|
|
|
|
otr.started.trusted=green
|
|
|
|
otr.started.untrusted=yellow
|
|
|
|
otr.ended=red
|
|
|
|
otr.trusted=green
|
|
|
|
otr.untrusted=yellow
|
2016-01-31 20:42:09 -05:00
|
|
|
online=green
|
|
|
|
away=cyan
|
|
|
|
chat=white
|
2016-01-21 20:24:02 -05:00
|
|
|
dnd=magenta
|
2016-01-31 20:42:09 -05:00
|
|
|
xa=blue
|
2016-01-21 20:24:02 -05:00
|
|
|
offline=red
|
|
|
|
incoming=bold_yellow
|
2016-02-10 16:38:28 -05:00
|
|
|
mention=bold_cyan
|
|
|
|
trigger=bold_blue
|
2016-01-21 20:24:02 -05:00
|
|
|
typing=yellow
|
|
|
|
gone=red
|
|
|
|
error=red
|
|
|
|
roominfo=yellow
|
2016-02-10 18:03:23 -05:00
|
|
|
roommention=bold_white
|
|
|
|
roommention.term=bold_cyan
|
2016-02-13 17:46:25 -05:00
|
|
|
roomtrigger=bold_white
|
|
|
|
roomtrigger.term=bold_blue
|
2016-01-21 20:24:02 -05:00
|
|
|
me=blue
|
|
|
|
them=bold_green
|
|
|
|
roster.header=bold_yellow
|
|
|
|
roster.chat=white
|
|
|
|
roster.online=green
|
|
|
|
roster.away=cyan
|
|
|
|
roster.xa=blue
|
|
|
|
roster.dnd=magenta
|
|
|
|
roster.offline=red
|
|
|
|
roster.chat.active=white
|
|
|
|
roster.online.active=green
|
|
|
|
roster.away.active=cyan
|
|
|
|
roster.xa.active=blue
|
|
|
|
roster.dnd.active=magenta
|
|
|
|
roster.offline.active=red
|
|
|
|
roster.chat.unread=bold_white
|
|
|
|
roster.online.unread=bold_green
|
|
|
|
roster.away.unread=bold_cyan
|
|
|
|
roster.xa.unread=bold_blue
|
|
|
|
roster.dnd.unread=bold_magenta
|
|
|
|
roster.offline.unread=bold_red
|
|
|
|
roster.room=green
|
|
|
|
roster.room.unread=bold_green
|
2016-01-31 20:42:09 -05:00
|
|
|
roster.room.mention=bold_cyan
|
|
|
|
roster.room.trigger=bold_blue
|
2016-01-21 20:24:02 -05:00
|
|
|
occupants.header=bold_yellow
|
|
|
|
receipt.sent=bold_black
|
|
|
|
|
|
|
|
[ui]
|
|
|
|
beep=false
|
|
|
|
flash=false
|
|
|
|
splash=true
|
|
|
|
wrap=true
|
|
|
|
time.console=%H:%M:%S
|
|
|
|
time.chat=%d/%m/%y %H:%M:%S
|
|
|
|
time.muc=%d/%m/%y %H:%M:%S
|
2018-04-11 12:57:50 -04:00
|
|
|
time.config=off
|
2016-01-21 20:24:02 -05:00
|
|
|
time.private=%d/%m/%y %H:%M:%S
|
2016-10-16 17:20:36 -04:00
|
|
|
time.xmlconsole=%H:%M:%S
|
2016-01-21 20:24:02 -05:00
|
|
|
time.statusbar=%H:%M:%S
|
|
|
|
time.lastactivity=%d/%m/%y %H:%M:%S
|
|
|
|
privileges=false
|
2016-01-31 20:42:09 -05:00
|
|
|
presence=false
|
2016-01-21 20:24:02 -05:00
|
|
|
intype=true
|
2016-01-31 20:42:09 -05:00
|
|
|
enc.warn=false
|
2016-01-21 20:24:02 -05:00
|
|
|
resource.title=false
|
|
|
|
resource.message=false
|
|
|
|
statuses.console=none
|
2016-01-31 20:42:09 -05:00
|
|
|
statuses.chat=all
|
2016-01-21 20:24:02 -05:00
|
|
|
statuses.muc=none
|
|
|
|
roster=true
|
|
|
|
roster.offline=false
|
|
|
|
roster.empty=false
|
2016-01-31 20:42:09 -05:00
|
|
|
roster.by=none
|
2016-01-21 20:24:02 -05:00
|
|
|
roster.order=presence
|
2016-01-31 20:42:09 -05:00
|
|
|
roster.unread=after
|
2016-01-21 20:24:02 -05:00
|
|
|
roster.priority=false
|
2018-02-09 19:01:26 -05:00
|
|
|
roster.size=15
|
2016-01-21 20:24:02 -05:00
|
|
|
roster.wrap=true
|
|
|
|
roster.contact.indent=1
|
|
|
|
roster.resource=false
|
2016-01-31 20:42:09 -05:00
|
|
|
roster.presence=false
|
2016-01-21 20:24:02 -05:00
|
|
|
roster.status=true
|
|
|
|
roster.contacts=true
|
2016-02-06 19:49:48 -05:00
|
|
|
roster.unsubscribed=true
|
2016-01-21 20:24:02 -05:00
|
|
|
roster.rooms=true
|
|
|
|
roster.rooms.order=name
|
2016-01-31 20:42:09 -05:00
|
|
|
roster.rooms.unread=after
|
2016-01-21 20:24:02 -05:00
|
|
|
roster.rooms.pos=first
|
2018-02-09 19:01:26 -05:00
|
|
|
roster.rooms.by=none
|
Improve MUC title behaviour for roster, statusbar, and titlebar
## Abstract
Continuation of https://github.com/profanity-im/profanity/pull/1881
Give all MUC title commands a consistent command structure and appearance.
- `/roster room use name|jid` and `/roster room show|hide server` are now `/roster room title bookmark|jid|localpart|name`
- `/statusbar room room|jid` is now `/statusbar room title bookmark|jid|localpart|name`
- `/statusbar show|hide jid` and `/statusbar show|hide name` are now `/titlebar room title bookmark|jid|localpart|name`
Fix both bugs mentioned in https://github.com/profanity-im/profanity/pull/1881
### src/ui/mucwin.c:mucwin_generate_title
Called by each command to generate a properly formatted title. It checks for "name" first because "name" is the default preference for each command. The last if-statement sets the title to "localpart" for special cases when the title should be "localpart" instead of the user-defined preference.
## Testing
### Preparation
Remove preferences that will interfere with testing.
```
sed -i "/roster.rooms.title=/d" profrc
sed -i "/statusbar.room.title=/d" profrc
sed -i "/titlebar.muc.title=/d" profrc
sed -i "/roster.rooms.use.name=/d" profrc
sed -i "/roster.rooms.server=/d" profrc
sed -i "/statusbar.room=/d" profrc
sed -i "/titlebar.muc.title.jid=/d" profrc
sed -i "/titlebar.muc.title.name=/d" profrc
sed -i "/roster.rooms.by=/d" profrc
```
### Command Definitions
| Test | Window |
| :--- | :--- |
| `/help roster` | - /roster room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the roster title for MUCs.<br>- *No /roster show\|hide server*<br>- *No /roster room use jid\|name* |
| `/help statusbar` | - /statusbar room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the title for MUC tabs.<br>- *No /statusbar room jid\|room* |
| `/help titlebar` | - /titlebar room title bookmark\|jid\|localpart\|name<br>- room title bookmark\|jid\|localpart\|name : Display the bookmark name, JID, JID localpart, or room name as the MUC window title.<br>- *No /titlebar show\|hide jid\|name* |
### Autocomplete
| Test | Command line |
| :--- | :--- |
| `/roster room <TAB>` | Autocompletes `title` |
| `/roster room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` |
| `/statusbar room <TAB>` | Autocompletes `title` |
| `/statusbar room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` |
| `/titlebar room <TAB>` | Autocompletes `title` |
| `/titlebar room title <TAB>` | Autocompletes `bookmark\|jid\|localpart\|name` |
| `/roster room <TAB>` | Does not autocomplete `use`, `show`, or `hide` |
| `/roster room use <TAB>` | Does not autocomplete `name` |
| `/roster room show <TAB>` | Does not autocomplete `server` |
| `/roster room hide <TAB>` | Does not autocomplete `server` |
| `/statusbar room <TAB>` | Does not autocomplete `jid` or `room` |
| `/titlebar show <TAB>` | Does not autocomplete `jid` or `name` |
| `/titlebar hide <TAB>` | Does not autocomplete `jid` or `name` |
### Set Preferences
| Test | Window | profrc |
| :--- | :--- | :--- |
| `/roster room title bookmark` | Roster MUCs will display 'bookmark' as their title. | roster.rooms.title=bookmark |
| `/roster room title jid` | Roster MUCs will display 'jid' as their title. | roster.rooms.title=jid |
| `/roster room title localpart` | Roster MUCs will display 'localpart' as their title. | roster.rooms.title=localpart |
| `/roster room title name` | Roster MUCs will display 'name' as their title. | roster.rooms.title=name |
| `/roster room title invalid` | Invalid usage, see '/help roster' for details. | |
| `/statusbar room title bookmark` | Displaying 'bookmark' as the title for MUC tabs. | statusbar.room.title=bookmark |
| `/statusbar room title jid` | Displaying 'jid' as the title for MUC tabs. | statusbar.room.title=jid |
| `/statusbar room title localpart` | Displaying 'localpart' as the title for MUC tabs. | statusbar.room.title=localpart |
| `/statusbar room title name` | Displaying 'name' as the title for MUC tabs. | statusbar.room.title=name |
| `/statusbar room title invalid` | Invalid usage, see '/help statusbar' for details. | |
| `/titlebar room title bookmark` | MUC windows will display 'bookmark' as the window title. | titlebar.muc.title=bookmark |
| `/titlebar room title jid` | MUC windows will display 'jid' as the window title. | titlebar.muc.title=jid |
| `/titlebar room title localpart` | MUC windows will display 'localpart' as the window title. | titlebar.muc.title=localpart |
| `/titlebar room title name` | MUC windows will display 'name' as the window title. | titlebar.muc.title=name |
| `/titlebar room title invalid` | Invalid usage, see '/help titlebar' for details. | |
| `/roster room use jid` | Invalid usage, see '/help roster' for details. | |
| `/roster room use name` | Invalid usage, see '/help roster' for details. | |
| `/roster room show server` | Invalid usage, see '/help roster' for details. | |
| `/roster room hide server` | Invalid usage, see '/help roster' for details. | |
| `/statusbar room jid` | Invalid usage, see '/help statusbar' for details. | |
| `/statusbar room room` | Invalid usage, see '/help statusbar' for details. | |
| `/titlebar show jid` | Invalid usage, see '/help titlebar' for details. | |
| `/titlebar hide jid` | Invalid usage, see '/help titlebar' for details. | |
| `/titlebar show name` | Invalid usage, see '/help titlebar' for details. | |
| `/titlebar hide name` | Invalid usage, see '/help titlebar' for details. | |
### Display Set Preferences
| Test | Window |
| :--- | :--- |
| /prefs ui | - Roster rooms title (/roster) : name<br>- Room tab display (/statusbar) : name<br>- MUC window title (/titlebar) : name |
### Test MUC Window
#### Test: without *name* preference, without *room name* field
```
/join muc@dmn.im
/room config
/field1 ""
/form submit
/quit
```
| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im |
| `/room config` | | muc<span/>@dmn.im conf | muc<span/>@dmn.im config |
| `/field2 edit` | | | muc<span/>@dmn.im config * |
| `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst |
| `/roster room by service` | muc | | |
#### Test: with *name* preference, without *room name* field
```
/roster room title name
/statusbar room title name
/titlebar room title name
/save
/quit
```
| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im |
| `/room config` | | muc<span/>@dmn.im conf | muc<span/>@dmn.im config |
| `/field2 edit` | | | muc<span/>@dmn.im config * |
| `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst |
| `/roster room by service` | muc | | |
#### Test: without *name* preference, with *room name* field
```
sed -i "/roster.rooms.title=/d" profrc
sed -i "/statusbar.room.title=/d" profrc
sed -i "/titlebar.muc.title=/d" profrc
/join muc@dmn.im
/room config
/field1 "my_room"
/form submit
/quit
```
| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | my_room | my_room | my_room |
| `/room config` | | my_room conf | my_room config |
| `/field2 edit` | | | my_room config * |
| `/msg tst` | tst | my_room/tst | my_room/tst |
| `/roster room by service` | my_room | | |
#### Test: with *name* preference, with *room name* field
```
/quit
/roster room title name
/statusbar room title name
/titlebar room title name
/save
/quit
```
| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | my_room | my_room | my_room |
| `/room config` | | my_room conf | my_room config |
| `/field2 edit` | | | my_room config * |
| `/msg tst` | tst | my_room/tst | my_room/tst |
| `/roster room by service` | my_room | | |
#### Test: with *localpart* preference
```
/quit
/roster room title localpart
/statusbar room title localpart
/titlebar room title localpart
/save
/quit
```
| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | muc | muc | muc |
| `/room config` | | muc conf | muc config |
| `/field2 edit` | | | muc config * |
| `/msg tst` | tst | muc/tst | muc/tst |
| `/roster room by service` | muc | | |
#### Test: with *bookmark* preference, without *bookmark name*
```
/quit
/roster room title bookmark
/statusbar room title bookmark
/titlebar room title bookmark
/save
/quit
/bookmark add muc@dmn.im
```
| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/bookmark join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im |
| `/room config` | | muc<span/>@dmn.im conf | muc<span/>@dmn.im config |
| `/field2 edit` | | | muc<span/>@dmn.im config * |
| `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst |
| `/roster room by service` | muc | | |
#### Test: with *bookmark* preference, with *bookmark name*
```
/quit
/bookmark remove muc@dmn.im
/bookmark add muc@dmn.im name "my_bookmark"
```
| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/bookmark join muc@dmn.im` | my_bookmark | my_bookmark | my_bookmark |
| `/room config` | | my_bookmark conf | my_bookmark config |
| `/field2 edit` | | | my_bookmark config * |
| `/msg tst` | tst | my_bookmark/tst | my_bookmark/tst |
| `/roster room by service` | my_bookmark | | |
#### Test: with *jid* preference
```
/quit
/roster room title jid
/statusbar room title jid
/titlebar room title jid
/save
/quit
```
| Test | Roster | Statusbar | Titlebar |
| :--- | :--- | :--- | :--- |
| `/join muc@dmn.im` | muc<span/>@dmn.im | muc<span/>@dmn.im | muc<span/>@dmn.im |
| `/room config` | | muc<span/>@dmn.im conf | muc<span/>@dmn.im config |
| `/field2 edit` | | | muc<span/>@dmn.im config * |
| `/msg tst` | tst | muc<span/>@dmn.im/tst | muc<span/>@dmn.im/tst |
| `/roster room by service` | muc | | |
### Test Contact Chat Window Title
#### Test: without contact nick
```
/roster add tst@dmn.im
```
| Test | Titlebar |
| :--- | :--- |
| `/msg tst@dmn.im` | tst<span/>@dmn.im |
#### Test: with contact nick
```
/roster add tst@dmn.im my_tst
```
| Test | Titlebar |
| :--- | :--- |
| `/msg my_tst` | my_tst <tst<span/>@ike.snikket.chat> |
### Test Preference Upgrade
#### Test /roster
| Test | profrc |
| :--- | :--- |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=name' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\roster.rooms.server=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc` | Original key removed.<br>roster.rooms.title=jid |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=false' profrc` | Original keys removed.<br>roster.rooms.title=localpart |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=true' profrc` | Original keys removed.<br>roster.rooms.title=jid |
| `sed -i '/\[ui\]/a\roster.rooms.use.name=jid' profrc`<br>`sed -i '/\[ui\]/a\roster.rooms.server=' profrc` | Original keys removed.<br>roster.rooms.title=jid |
| `sed -i '/\[ui\]/a\statusbar.room=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\statusbar.room=room' profrc` | Original key removed.<br>statusbar.room.title=localpart |
| `sed -i '/\[ui\]/a\statusbar.room=jid' profrc` | Original key removed.<br>statusbar.room.title=jid |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.name=' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=false' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.name=false' profrc` | Original key removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=false' profrc` | Original key removed.<br>titlebar.muc.title=jid |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=false' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original keys removed. |
| `sed -i '/\[ui\]/a\titlebar.muc.title.jid=true' profrc`<br>`sed -i '/\[ui\]/a\titlebar.muc.title.name=true' profrc` | Original keys removed. |
### Test Valgrind
No memory leaks detected relating to these changes.
2023-10-05 20:16:04 -04:00
|
|
|
roster.rooms.title=localpart
|
2016-01-31 20:42:09 -05:00
|
|
|
roster.rooms.private.char=/
|
|
|
|
roster.private=room
|
|
|
|
roster.count=unread
|
|
|
|
roster.count.zero=false
|
2016-01-21 20:24:02 -05:00
|
|
|
occupants=true
|
|
|
|
occupants.size=15
|
|
|
|
occupants.jid=false
|
|
|
|
wins.autotidy=true
|
|
|
|
otr.char=@
|
|
|
|
pgp.char=%
|
2019-06-05 05:01:58 -04:00
|
|
|
omemo.char=*
|
2016-01-21 20:24:02 -05:00
|
|
|
tls.show=true
|
2016-01-31 20:42:09 -05:00
|
|
|
console.muc=first
|
2016-02-03 18:02:52 -05:00
|
|
|
console.chat=all
|
2016-02-03 18:39:20 -05:00
|
|
|
console.private=all
|
2016-09-22 19:56:53 -04:00
|
|
|
titlebar.position=1
|
|
|
|
mainwin.position=2
|
|
|
|
statusbar.position=3
|
|
|
|
inputwin.position=4
|