about summary refs log tree commit diff stats
path: root/src/ui/window.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixes Statusbar tabs and CleanupJohn Hernandez2023-04-101-1/+1
| | | | | | | | | | - 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
* Improve titlebar flexibilityJohn Hernandez2023-04-101-9/+17
| | | | | | | Before this change, only nickname or JID (if no nickname set) is shown in the titlebar. Change allows to alter nickname/JID preference using already implemented /titlebar show jid|name setting. If both are set to "show", then it is displayed in "nickname <JID>" format.
* Add WIN_VCARD to win_get_tab_identifier()Michael Vetter2023-03-231-0/+4
| | | | | | Thanks to 12b997c5f34776f34634d4ca155a14586aebc905 we already found a place where we should add this missing window type. AFAIK there can be only one vcard window.
* ui: make it easier to find non covered window typesMichael Vetter2023-03-231-20/+31
| | | | | | | | | | | | | | | | Rewrite `win_get_title()` to using switch without a default case. So the compiler warns us (`enumeration value ‘WIN_XXX’ not handled in switch`) in case we add a new window type (WIN_CHAT, WIN_PRIV etc) and forget to adapt this function. Add assert() in the end to make compiler happy when he realizes there the function might have no return value (`control reaches end of non-void function`). This should ever be reached. Replace the default value of `win_to_string()`, `win_get_tab_identifier()` as well, and replace it with an assert. See discussion started at https://github.com/profanity-im/profanity/pull/1799#discussion_r1142444684
* Adapt to g_string_free glib 2.75.3 changeMichael Vetter2023-03-211-12/+4
| | | | | | | | | | | | glib 2.75.3 changes warning behaviour of `g_string_free()`. See: * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3219 * https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3226 Use this opportunity to replace the use of GString with `g_strdup_printf()` where possible. Otherwise correctly take the return value of `g_string_free()` which is nicer anyways.
* Fix duplicate download IDs.IsaacM882023-03-091-2/+2
| | | | | | | | | | Fixes https://github.com/profanity-im/profanity/issues/1794 Explanation The problem is the download's identifier. Downloads are given an ID so they can be referenced later when their progress changes. Currently, the download's ID is the download's URL. When you download the same file twice, you have two downloads with the same ID. Download progress updates are shown on the first of both downloads with the same ID. Solution Change the download's ID from its URL to a random number. A random ID is generated when get_random_string() is called from cmd_funcs.c. Several other functions are updated to cope with the new ID format.
* Fix quote and url autocompletion for MAM and historyMarcoPolo-PasTonMolo2023-02-131-0/+5
| | | | | | | | After adding MAM quote and url autocompletion wouldn't pick up messages from MAM or history(from DB) or would have them in the wrong order. This commit fixes that. Fixes https://github.com/profanity-im/profanity/issues/1770
* fix more memory leaksSteffen Jaeckel2023-01-181-1/+1
| | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* Update copyright yearMichael Vetter2023-01-101-1/+1
|
* Fix segfault when loading from MAMMarcoPolo-PasTonMolo2022-10-221-2/+13
| | | | | | When loading messages from MAM profanity would segfault. Reason was that we were freeing the timestamp of messages when displaying them and we needed it for loading MAM.
* Apply codigng style on new MAM codeMichael Vetter2022-10-211-1/+1
|
* Let users scroll up againMichael Vetter2022-10-211-4/+0
| | | | | | | | | | | | We removed this so that we don't get "[SCROLLED]" in the titlebar when there is actually not more text available. But now with MAM we can enable this again so that the user can scroll up and load more text out of the database. Maybe this also could use a check. This reverts commit c84b1b5e5d038684a6a475a251b738c3c5ffb9a5.
* Merge MAM improvements from #1724Michael Vetter2022-10-211-3/+67
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think this PR already solves and improves the MAM situation a lot. What's @MarcoPolo-PasTonMolo still wanted to do in this branch is: * MAM for mucs * Check if url and quotes autocompletion works fine * Check if the api still works fine * Resolve conflicts Conflicts are solved with this commit. MAM for mucs can be another feature PR. The rest we can check while being on master. And more people can help testing.
| * Handle late deliveryMarcoPolo-PasTonMolo2022-08-201-0/+1
| |
| * Have ability to scroll through history even without MAMMarcoPolo-PasTonMolo2022-07-101-3/+3
| |
| * Handle scrolling down when buffer fills upMarcoPolo-PasTonMolo2022-07-101-1/+15
| |
| * CleanupMarcoPolo-PasTonMolo2022-07-051-7/+2
| |
| * Add loading history message on initial MAM requestMarcoPolo-PasTonMolo2022-07-051-2/+10
| | | | | | | | | | | | This prevents scrolling to top and initiating another MAM request while still fetching the initial one. Also free timestamp object in database.c
| * Fix initial MAM not displayingMarcoPolo-PasTonMolo2022-07-051-7/+6
| | | | | | | | | | | | Did this by waiting for a batch of MAM messages to arrive before prepending them to the buffer. Also limited the number of messages to fetch to 10 so that the user gets more frequent updates.
| * Add 'Loading messages' message when scrolling upMarcoPolo-PasTonMolo2022-07-041-5/+13
| |
| * Fech data from mam when all history gets displayedMarcoPolo-PasTonMolo2022-07-031-1/+7
| | | | | | | | | | | | Fetch from mam without displaying when all mam messages get received display new messages from db. Unstable, initial mam doesn't get displayed unless we start scrolling.
| * Get messages from history when scrolling up.MarcoPolo-PasTonMolo2022-07-031-3/+36
| |
* | Add vCard supportMarouane L2022-10-181-0/+189
| | | | | | | | | | | | | | | | | | | | | | | | Only nicknames, photos, birthdays, addresses, telephone numbers, emails, JIDs, titles, roles, notes, and URLs are supported Due to the synopsis array not having enough space, `/vcard photo open-self` and `/vcard photo save-self` are not documented properly in the synopsis section of the `/vcard` command, but they are documented in the arguments section Fixed memory leak in vcard autocomplete (thanks to debXwoody)
* | Don't scroll if not neededMichael Vetter2022-06-291-0/+4
|/ | | | | | | | | If we are in a window with a lot of text and press PAGE UP we scroll up and write [scrolled] in the titlebar. So far we also wrote [scrolled] in there even when actually nothing happened. Like when opening a new window (/msg someone) and there is no text inside.
* Fix duplicate messages in chat with oneself.MarcoPolo-PasTonMolo2022-05-311-1/+5
| | | | | | | | | | | | Messages would get duplicated when you chat with yourself, worse if you had omemo enabled the duplicated message would say something along the lines of "Your client doesn't support OMEMO". The cause was carbons when the message was sent from another client, whilst it was a sent and received message when profanity was the one to send it. This commit ignores the carbon message in the 1st case and ignores the received one in the 2nd. Fixes https://github.com/profanity-im/profanity/issues/1595
* Update copyright yearMichael Vetter2022-05-091-1/+1
|
* Restore default behaviour for stampsMichael Vetter2022-05-031-1/+1
| | | | | | | | | | | | @mdosch discovered that we now don't print `:` for messages from others anymore. Until https://github.com/profanity-im/profanity/pull/1663#issuecomment-1114625151 is fixed lets restore the default behaviour to always add `:` in `_win_print_internal()`. The result will be that a stamp set to `-->` will also look like `-->:`.
* Merge branch 'master' into add_stamp_settingsMichael Vetter2022-04-281-3/+5
|\
| * Use correct colour for their nick when showing historyPaul Fertser2022-04-011-0/+1
| |
| * fix linter warningsSteffen Jaeckel2022-03-311-1/+2
| | | | | | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
| * run `make format`Steffen Jaeckel2022-03-301-2/+2
| | | | | | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* | Rename stamp preference variableMichael Vetter2022-04-281-1/+1
| | | | | | | | | | PREF_INCOMING_STR -> PREF_INCOMING_STAMP PREF_OUTGOING_STR -> PREF_OUTGOING_STAMP
* | add /stamp commandArtjom Vejsel2022-04-021-2/+3
|/ | | | command allow override standard stamps of incoming and outgoing messages
* Use funcs available in all glib versions to replace \n in quotesMarcoPolo-PasTonMolo2022-03-211-2/+7
|
* Add quote autocompletion for previous messagesMarcoPolo-PasTonMolo2022-03-211-0/+23
| | | | | | | | | | Fixes https://github.com/profanity-im/profanity/issues/1649 Type `>` then press tab or shift tab to autocomplete previous messages, then type your reply and send message. Newlines are replaced with newline followed by `> `. A newline is added at the end so that the user can immediately type a message without manually adding a new line.
* auto-formatSteffen Jaeckel2022-02-011-1/+1
| | | | Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
* Move declaration and definition of win_get_last_sent_message to the correct ↵MarcoPolo-PasTonMolo2021-10-221-0/+29
| | | | place
* Format code correctlyMichael Vetter2021-10-051-4/+3
|
* Attention flag - Implemented Alt+mDebXWoody2021-05-291-0/+33
|
* Attention flag for groupchatsDebXWoody2021-05-291-0/+1
| | | | Attention flag for groupchat and display the windows via "/wins attention"
* Attention flag for chat windowsDebXWoody2021-05-291-1/+1
| | | | | | | User is able to toggle a flag for chat windows. This flag should be used to mark the window for "Attention". Use Ctrl+f to mark the window.
* MUC: Show offline members in sidebarThorben Günther2021-03-081-0/+5
|
* Bugfix: Titlebar show name without room nameStefan2021-02-141-1/+1
| | | | | | | Error log: GLib-CRITICAL - g_string_insert_len: assertion 'len == 0 || val != NULL' failed Check if a room name exists, before adding the name into the title bar.
* Update copyrightMichael Vetter2021-01-081-1/+1
|
* Remove blank line after trackbarkaffeekanne2020-12-111-2/+0
| | | | Remove added blank line after trackbar, introduced by 606c1e51e688cb111b9837579a35460508324b63
* Remove old TODOMichael Vetter2020-12-111-1/+0
| | | | | | | | | | | | It was added in f7fe87dd4e7e14112fbcb0ae8794d90ffee64f2f when I rewrote window functions to include more infos (not just char* but whole jid struct I think). The same todo was added to win_print_outgoing_muc() but removed in f3d9de133e90ed10b5b7bd61196619eab1fedb19. This TODO should have been removed in f3d9de133e90ed10b5b7bd61196619eab1fedb19 since there we added the myjid parameter.
* Fix color for win_print_outgoing()Michael Vetter2020-12-111-1/+1
| | | | | | | | | | | | | Discovered by @aba-hollerer. Mistake was introduced in b6b7dd5ad497a71e250b8b3cef0bb987314b141d probably due to a wrong copy/paste. First wasn't reproducible because I had `/receipts request on` and thus win_print_outgoing_receipts() is used which has the correct THEME_TEXT_ME. Fixes https://github.com/profanity-im/profanity/issues/1441
* Remove empty lineMichael Vetter2020-12-101-1/+0
|
* Expand trackbar to whole lineMichael Vetter2020-12-091-1/+1
| | | | Fix https://github.com/profanity-im/profanity/issues/1448
* Run make format on rebaseWilliam Wennerström2020-11-161-1/+1
|