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

68 Commits

Author SHA1 Message Date
Steffen Jaeckel
dc0f2acb9a Simplify usage of roster_get_display_name()
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-12-12 18:27:11 +01:00
Đoàn Trần Công Danh
5a72fefe89 plugin: python: fix build for Python 3.11
From Python 3.11, PyFrameObject has been changed into opaque struct.
We need to access those fields via API.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2022-09-24 12:49:12 +07:00
j.r
5676159aa5
Fix python executed during configure
Previously it relied on AX_PYTHON_DEVEL, which in turn executes
python-config to get the build flags. However this does not work while
cross compiling because we can't execute the python-config build for the
target platform. To circumvent this problem the python build flags are
now queried via pkgconfig, which has the drawback of not having some
extra build flags, but they do not seem to be needed.

I tested this patch with the termux build system and it build without
their existing hack of injecting python after the configure step. I also
tested non cross compile build on Arch Linux and it also still works.

Fixes #851
2022-02-18 19:45:31 +01:00
Sergei Trofimovich
f0a39a4b66 python_api.c: enlarge c_arguments array to avoid OOB write
Code below explicitly refers past `args_len`th element:

        c_arguments[args_len][0] = NULL;
        c_arguments[args_len][1] = NULL;

Let's always allocate space for `NULL`. Noticed by Steffen Jaeckel.
2021-11-26 07:54:01 +00:00
Sergei Trofimovich
a77a57a6a4 src/plugins/python_api.c: drop redundant NULL pointer check
gcc-12 detects redundant check against array of arrays as:

    src/plugins/python_api.c: In function ‘python_api_register_command’:
    src/plugins/python_api.c:199:31: error: the comparison will always evaluate as ‘true’ for the address of ‘c_arguments’ will never be NULL [-Werror=address]
      199 |         while (c_arguments[i] != NULL && c_arguments[i][0] != NULL) {
          |                               ^~
    src/plugins/python_api.c:161:15: note: ‘c_arguments’ declared here
      161 |         char* c_arguments[args_len == 0 ? 0 : args_len + 1][2];
          |               ^~~~~~~~~~~
2021-11-18 22:29:11 +00:00
Dustin Lagoy
2350a94c44 Add plugin get_barejid_from_roster function 2021-04-29 13:50:57 -04:00
Dustin Lagoy
802442fffc Change nick to name in api to match convention
Change all instances of *get_nick_from_roster to *get_name_from_roster
to match the convention of names in the roster itself.
2021-04-28 09:32:20 -04:00
Dustin Lagoy
ed4d2fcfb2 Add plugin prof_get_nick_from_roster function 2021-04-28 09:17:02 -04: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
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Dmitry Podgorny
69bba3ea4e plugins/python: fix double _XOPEN_SOURCE definition
ncursesw defines _XOPEN_SOURCE macro via command-line. In particular, it
is defined in ncursesw.pc and extracted via pkg-config. From other side,
Python defines the same macro unconditionally in pyconfig.h. Python-3.x
defines the macro with value different than ncursesw does. In turn, this
causes a warning that the macro is redefined. And warnings are treated
as errors.

Since both entities define the mecro unconditionally, we can't simply
reorder headers as Python developers suggest. So, undefine the macro
just before the <Python.h> to fix this silly issue.
2019-10-15 12:30:38 +00:00
Michael Vetter
d3dd95963e Sort includes in python_api.c 2019-10-07 15:53:17 +02:00
Michael Vetter
e75cc41164 Fix double initialization of loop iterator 2019-07-22 14:02:33 +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
68a3daedb9 Update Copyright 2017-01-28 17:24:22 +00:00
James Booth
7090f85d85 Add chat and room show calls to plugins api 2017-01-21 20:23:28 +00:00
James Booth
9cfd17821c Allow room display properies to be set by plugins 2017-01-20 23:26:14 +00:00
James Booth
c8874cd2e0 Allow chat prefix char to be set by plugins 2017-01-20 21:03:55 +00:00
James Booth
1b25aa84cb Add titlebar encryption text to plugins api 2017-01-19 22:33:29 +00:00
James Booth
fccf56be10 Add prof.encryption_reset to Plugins API
issue #885
2017-01-18 22:46:29 +00:00
James Booth
8008d8c3c6 Add get_room_nick to plugins api 2016-11-06 23:01:16 +00:00
James Booth
dcc2123ec4 Allow filepath autocompletion in plugins
closes #858
2016-10-10 22:28:23 +01:00
James Booth
a65403c54a Remove disco features added by plugins on unload 2016-08-11 23:20:59 +01:00
James Booth
efeb2fcfcd Rename plugins settings functions 2016-08-07 00:16:57 +01:00
James Booth
b2508be8f4 Return boolean on prof_settings_string_list_remove_all() 2016-08-01 22:09:25 +01:00
James Booth
b72bb3a157 Remove log debugs 2016-08-01 21:59:12 +01:00
James Booth
2518aa5078 Add string lists settings to plugins 2016-08-01 21:34:38 +01:00
James Booth
943e91268c Fix memory leaks 2016-07-25 21:56:38 +01:00
James Booth
130e753aac Use Py_RETURN_NONE 2016-07-25 21:13:47 +01:00
James Booth
8f9f018d5a Free python_str_or_unicode_to_string results 2016-07-25 00:41:34 +01:00
James Booth
cbfc34f7c3 Remove debug on plugin win create 2016-07-24 22:32:39 +01:00
James Booth
0a57c4de78 Tidy headers 2016-07-24 15:43:51 +01:00
James Booth
7c593c2780 Reorder headers 2016-07-24 02:16:57 +01:00
James Booth
b48a3d2f6a Python plugins: Free string values 2016-07-24 01:53:13 +01:00
James Booth
47dfa6c3fc Merge branch 'master' into python3
Conflicts:
	.gitignore
2016-07-24 01:22:29 +01:00
James Booth
e8fc80f5c1 Update GPL link in headers 2016-07-24 01:14:49 +01:00
James Booth
d44472049b Allow str and unicode in python api 2016-07-24 01:09:18 +01:00
James Booth
376811a960 Tidy python3 conditional code 2016-07-19 01:02:33 +01:00
James Booth
71ccfcc09f Add python_init_prof() 2016-07-18 23:24:26 +01:00
James Booth
7d742f704f Fix prof module init for python3 2016-07-18 01:27:23 +01:00
James Booth
ace2715cf7 Added PYTHON3 define 2016-07-14 00:00:46 +01:00
James Booth
fd218ac3e4 Pass plugin name to all autocompleter functions 2016-07-04 23:14:08 +01:00
James Booth
71879a3f64 Free plugins commands on quit 2016-07-04 00:41:29 +01:00
James Booth
70a79abd3b Add plugin name to win_create api call 2016-07-03 00:48:22 +01:00
James Booth
56480ce9ea Pass plugin name to api layer 2016-06-30 22:54:46 +01:00
James Booth
29eb843d56 Revert "WIP - Unload plugin commands"
This reverts commit a01eb5d08e.
2016-06-30 22:37:52 +01:00
James Booth
a01eb5d08e WIP - Unload plugin commands 2016-06-29 23:35:57 +01:00