1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-30 21:55:24 +00:00
Commit Graph

98 Commits

Author SHA1 Message Date
John Hernandez
7d290b04d5 Fixes Statusbar tabs and Cleanup
- Fixes statusbar tabs.
Bug: Statusbar used nickname if it was set in roster,
irrelevant to /statusbar chat setting.
Expected behaviour would be using this setting set as "user" to show nickname,
and to show jid with "jid" setting.
Other solution is to give a user control over it with another settings.
- _status_bar_draw_maintext cleaned up, no changes to behaviour
2023-04-10 16:28:44 +02:00
Steffen Jaeckel
0cf79848e9 add /statusbar tabmode actlist
The existing way how active tabs are displayed didn't allow showing more
than 10 tabs. This patch adds a mode where the statusbar shows a
comma-separated list of tabs which were active since the last time viewed.
This view is inspired by how `irssi` shows the active tabs, therefore
it is also called `actlist`.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-04-08 18:38:36 +02:00
Michael Vetter
3adc399da0 Update copyright year 2023-01-10 10:37:25 +01:00
Michael Vetter
1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
Michael Vetter
242696f09a Fix fromat string in statusbar
Regards https://github.com/profanity-im/profanity/issues/1597#issuecomment-930540261
2021-09-29 23:25:38 +02:00
Michael Vetter
8c08e64f37 Update copyright 2021-01-08 16:36:30 +01:00
Michael Vetter
35aecd425f Declare counter var inside loop
We require c99/gnu99 anyways.
2020-11-09 11:33:33 +01:00
nia
52e9be4abc Basic support for building on NetBSD.
- Add NetBSD as a recognized platform without -ldl.
- Allow building with NetBSD libcurses instead of ncurses.
- Portability to NetBSD sh - use POSIX '=' instead of '=='.
2020-09-04 12:55:20 +02:00
Michael Vetter
a2726b6a7d Apply coding style 2020-07-07 14:18:57 +02:00
Michael Vetter
a4cadf78fa Revert "Apply coding style"
This reverts commit 9b55f2dec0.

Sorting the includes creates some problems.
2020-07-07 13:53:30 +02:00
Michael Vetter
9b55f2dec0 Apply coding style
Regards https://github.com/profanity-im/profanity/issues/1396
2020-07-07 09:43:28 +02:00
Michael Vetter
e5ac12afa6 Remove prefs_free_string()
It just does a free.
Related to b580b9ef11
2020-07-02 11:34:12 +02:00
Michael Vetter
cb78ee4665 Make option to allow hiding windows with no messages in statusbar
`statusbar.show.read` can be set to false in the config.
`/statusbar show|hide read`.

Implement https://github.com/profanity-im/profanity/issues/1285
2020-05-21 16:15:14 +02:00
Michael Vetter
9e73782f72 _destroy_tab() dont set tab to NULL
Setting the local pointer to NULL has no effect.

_destroy_tab() is used for g_hash_table_new_full() so we cant use a **
and set tab to NULL.
2020-04-20 16:10:24 +02:00
Michael Vetter
7e62d458ee Make statusbar tab more resilient
If users input strange stuff and we can't create a jid from it even the
setting is set to 'user' we still should fallback to the regular
identifer.

For example with `/msg @name%matrix.domain.org@matrix.org hi`.
2020-03-09 16:33:42 +01:00
Michael Vetter
be13e98fe7 Update my Copyright to 2020 2020-01-03 19:52:31 +01:00
Michael Vetter
19de066008 Call ncurses resize function before move function
From @xaizek s comment on issue #1235:
```
If the move would cause the window to be off the screen, it is an error and the window
is not moved.

Resize on the other hand doesn't fail like this according to its documentation. So new size needs to be applied first.
```

Big thanks to @xaizek for taking a look at our code and helping us!!

Regards https://github.com/profanity-im/profanity/issues/1235
2019-12-02 14:03:53 +01:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
d1f388cbd7 Add comment about statusbar.current 2019-09-29 15:47:11 +02:00
Daniel Lublin
641410f6bd Add coloring of statusbar.current tab in view
This theme color applies to the tab title text of the statusbar tab that
is currently shown.

The (somewhat confusingly named) `statusbar.active` theme color now
applies to all other tabs (before, it applied to all tabs).

Coloring of a tab that is highlighted/has new messages is done as before
using the `statusbar.new` theme color.

The default color is set to `cyan`, and thus causes no visible change
for users -- until modified.
2019-09-24 10:35:30 +02:00
Dmitry Podgorny
8c69d7105b Don't crash if source jid doesn't contain the node part
Profanity uses the node part of a JID as display name for a tab. If such
a JID doesn't contain the node part, Profanity crashes on NULL pointer
dereference.

In the above case, use barejid which is just a domain. Fixes #1153.
2019-08-26 12:46:30 +03:00
Michael Vetter
137d128af2 Remove unused assignments 2019-07-22 14:16:10 +02:00
Michael Vetter
eb14ae5f03 Fix jump depending on uninit. value in statusbar 2019-07-10 12:55:49 +02:00
Michael Vetter
184f01c4ac Fix prefs_get_string mem leaks in statusbar 2019-06-19 16:45:18 +02:00
Michael Vetter
40b72ffe55 Add myself to copyright
Like discussed with James.
2019-06-17 10:44:08 +02:00
Michael Vetter
b210fb3603 statusbar: check if roster exists
We destory the roster in ev_disconnect_cleanup().
Adding a function to test if the roster has been destroyed and testing
for it in the statusbar.

So now when the connection is lost 'Lost connection' is printed in all
open windows.
We can then reconnect with `/connect accountname`.

Should fix https://github.com/profanity-im/profanity/issues/1083
2019-06-04 16:19:04 +02:00
Michael Vetter
2d00444702 statusbar: reduce duplicate code
status_bar_new() and status_bar_active() are almost identical.
Let's use one helper function to not duplicate code.

I thought about renaming both functions into one and adding another
parameter but didn't come up with a good name for the function that
clearly describes what it does. So staying with current names + helper
functions.
2019-06-04 14:50:25 +02:00
Michael Vetter
ea62c3f293 Determine chat window names beforehand
Save the name for displaying the windows in the statusbar inside the tab
object.
So far we calculated them repeatedly and this created issues when we
lost the connection.

Regards https://github.com/profanity-im/profanity/issues/1083
2019-06-04 12:33:57 +02:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
Paul Fariello
a952776b89 Rename mucconf wins into conf wins
Configuration windows are now being used by both muc and cmd.
2018-09-05 13:51:00 +02:00
James Booth
d6e7f389d1 Add max tab length to statusbar 2018-03-11 01:18:46 +00:00
James Booth
9f24f6083b Fix utf8 chars in statusbar 2018-03-11 00:46:27 +00:00
James Booth
8718b368a1 Statusbar render at start of small window 2018-03-10 23:01:51 +00:00
James Booth
b0e70e6caa Dont show extended tabs when max 0 2018-03-10 22:54:02 +00:00
James Booth
4bf67fb35a Use jid prefs in statusbar 2018-03-10 22:41:55 +00:00
James Booth
95b639a21f WIP add self prefs for statusbar 2018-03-10 22:16:52 +00:00
James Booth
5dbddf4d43 Show extended tabs 2018-03-10 01:30:28 +00:00
James Booth
73bb628fd8 Refactor statusbar 2018-03-10 00:32:56 +00:00
James Booth
6f5c0eb525 Preference to show/hide tab number 2018-03-09 23:44:28 +00:00
James Booth
136b975b6c Remove empty tabs 2018-03-09 22:42:20 +00:00
James Booth
59382984c0 Add preferences for tab display 2018-03-09 21:15:27 +00:00
James Booth
a957c545d3 Add max tabs preference for statusbar 2018-03-08 23:11:49 +00:00
James Booth
720dce866e Add prefs for empty tabs and tab names 2018-03-08 22:27:49 +00:00
James Booth
119c5650cf Show name in statusbar tabs WIP 2018-03-08 20:01:36 +00:00
James Booth
1215ec9bc8 Add message to status bar 2018-03-07 22:22:53 +00:00
James Booth
be8ff9fdcd Set background in _status_bar_draw 2018-03-07 21:37:29 +00:00
James Booth
105c9c2943 Add time to status bar 2018-03-07 21:29:41 +00:00
James Booth
fcdddf11c0 Draw empty status bar 2018-03-07 20:58:07 +00:00
James Booth
250e972b7a Update copyright 2018-01-21 15:00:02 +00:00
Lukasz Marcinowski
91bc302acf Add theme option for time in a status bar 2017-03-22 19:56:00 +01:00