1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-15 19:38:07 -04:00
Commit Graph

69 Commits

Author SHA1 Message Date
John Hernandez
e1d137f4e6 Change char->free to auto_char char for autocleanup
Replace `gchar` and `g_free` to `auto_gchar`
Correct certain  `char` functions/variables to `gchar`

Related to #1819.

Edited by @jubalh.
2023-07-11 13:26:37 +02:00
John Hernandez
7f3fca2bd0 Cleanup: gchar as gchar instead of char
Use gchar instead of char in most of the cases where gchar is intended.

Reason: improve compatibility and stability. Issue #1819

Minor refactoring.
2023-05-04 16:15:09 +02:00
Steffen Jaeckel
af6f468cb7 fix memory leak
`found` was leaked before

This was somehow missed in e9aaba938b

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-04-04 10:58:52 +02:00
Michael Vetter
e59c401c84 Adapt to g_string_free glib 2.75.3 change
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.
2023-03-21 10:53:10 +01:00
MarcoPolo-PasTonMolo
6d266984a4 Fix quote and url autocompletion for MAM and history
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
2023-02-13 23:40:58 +02:00
Steffen Jaeckel
e9aaba938b minor changes
* fix typo
* less code duplication
* less `GString` usage
* more `auto_gchar` usage
* document connecting to servers supporting SASL ANONYMOUS
* ignore valgrind output

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Michael Vetter
f21595597f Format code correctly 2021-10-05 10:01:27 +02:00
Michael Vetter
1ec606540e Get rid of asprintf and _GNU_SOURCE define
_GNU_SOURCE was even in some files where it was not needed at all
(http*).

Let's replace asprintf() with g_strdup_printf().
2021-03-30 17:38:13 +02:00
Michael Vetter
057c9ad776 Add config.h in files were it was missing
Related to https://github.com/profanity-im/profanity/issues/1512
2021-03-26 19:54:22 +01:00
Michael Vetter
638a50f8d1 autocomplete: remove duplicate code in search functions
_search_next and _search_prev where exactly the same except taking the
nex/prev from the list.
Use one function with a direction argument.
2021-03-11 22:24:27 +01:00
Michael Vetter
e3133ed98f autocomplete: Use asprintf don't calculate length twice
Through asprintf() we can get rid of malloc() + sprintf().
Also we don't need to calculate the strlen() again since asprintf()
returns the bytes printes.

Only non UTF-8 characters. But that was true before already.
2021-03-11 22:24:02 +01:00
Michael Vetter
c1ccaee58f Remove duplicate code in autocomplete_param*
autocomplete_param_with_func and -autocomplete_param_with_ac had lots of
duplicate code.
2021-03-11 22:08:04 +01:00
Michael Vetter
35aecd425f Declare counter var inside loop
We require c99/gnu99 anyways.
2020-11-09 11:33:33 +01: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
de91a99178 Fix memleak in autocomplete_remove_older_than_max* 2020-05-29 11:28:58 +02:00
Michael Vetter
bfaf737efa urlopen: get last URL first
Fix https://github.com/profanity-im/profanity/issues/1348
2020-05-29 11:26:18 +02:00
Michael Vetter
aef74f90ec Only save max 20 urls 2020-05-20 10:54:58 +02:00
Paul Fariello
a52e3ea1d8 Add context to autocomplete_with_func and use it for omemo trust command
Fix #1068
2020-01-31 10:07:08 +01:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
9b3517c21e Free strings in autocomplete_param_no_with_func
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 19:05:27 +02:00
William Wennerström
0c10a699f2
Always check for directory changes with sendfile auto completion
Instead of only checking for files when 'last_directory' has changed, do
it every time.

Add autocomplete_update function that updates the items while retaining
last_found and search_str.

Fixes #1099
2019-07-20 10:38:22 +02:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
James Booth
250e972b7a Update copyright 2018-01-21 15:00:02 +00:00
James Booth
6b830277a6 Allow previous autocompletion with shift tab 2017-04-01 00:27:11 +01:00
James Booth
131c98b305 Add missing header 2017-03-25 01:48:40 +00:00
James Booth
b5e0106526 Autocomplete accent and case insensitive 2017-03-25 01:40:20 +00:00
James Booth
68a3daedb9 Update Copyright 2017-01-28 17:24:22 +00:00
James Booth
e8fc80f5c1 Update GPL link in headers 2016-07-24 01:14:49 +01:00
James Booth
71178b3696 Store plugin completers by plugin name 2016-07-05 21:46:36 +01:00
James Booth
f377e0329e Allow autocomplete for basic compelters when no input 2016-05-24 00:32:53 +01:00
James Booth
e53e94f1e2 Updated copyright 2016-02-14 22:54:46 +00:00
James Booth
0017098400 Applied coding style to src/tools/ 2015-10-25 22:47:42 +00:00
James Booth
b3be26a214 Updated copyright 2015-02-10 23:16:09 +00:00
James Booth
4c6cfcdca0 Simplified autocompleters and command history 2015-01-16 22:50:40 +00:00
James Booth
a4f7932ed7 Check for NULL inside autocomplete_free 2014-09-26 00:48:48 +01:00
James Booth
0b2a1a1bc7 Renamed autocomplete function to get list 2014-09-26 00:06:50 +01:00
James Booth
a905ce18a3 Added autocompletion for jid-multi form fields 2014-09-17 23:36:10 +01:00
James Booth
45ba6f1fed Added autocompletion for form text-multi values 2014-09-17 23:35:51 +01:00
James Booth
b934ad54d5 Added form tests 2014-09-14 22:31:27 +01:00
James Booth
f9737251a6 Added license exemption for OpenSSL to source headers 2014-08-24 20:57:39 +01:00
James Booth
cc62fe376c Finished chat room nick autocomplete 2014-07-15 21:30:23 +01:00
James Booth
2f3234a5f5 Added quote param to autocomplete_param_with_ac 2014-07-09 20:32:28 +01:00
James Booth
954661e59e Added quote param to autocomplete_complete 2014-07-09 20:23:47 +01:00
James Booth
0c9851106b Added quote param to autocomplete searches 2014-07-09 20:15:20 +01:00
James Booth
b9b5d6a5f8 Fixed memleak in autocompleter 2014-06-15 17:32:30 +01:00
James Booth
a519d25e4b Fixed potential segfaults on autocomplete 2014-05-08 20:49:41 +01:00
James Booth
d6e92f62dc Fixed cppcheck warnings 2014-04-26 00:36:36 +01:00
James Booth
a720ef2627 Removed strcpy calls 2014-04-02 21:01:20 +01:00