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

196 Commits

Author SHA1 Message Date
Đ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
Sergei Trofimovich
753d9dbbdb src/plugins/callbacks.c: drop redundant NULL pointer check
gcc-12 detects redundant check against array of arrays as:

    src/plugins/callbacks.c: In function ‘_free_command_help’:
    src/plugins/callbacks.c:85:26: error: the comparison will always evaluate as ‘true’ for the address of ‘args’ will never be NULL [-Werror=address]
       85 |     while (help->args[i] != NULL && help->args[i][0] != NULL) {
          |                          ^~
    In file included from ./src/ui/ui.h:44,
                     from ./src/command/cmd_defs.h:42,
                     from src/plugins/callbacks.c:41:
    ./src/command/cmd_funcs.h:48:12: note: ‘args’ declared here
       48 |     gchar* args[128][2];
          |            ^~~~
2021-11-18 22:27:20 +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
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
a94378f206 Fix various typos 2020-12-10 09:24:32 +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
11d849aa7f Dont hilight console once all messages have been read
If we receive a message we get:
<< room message: eagle@conference.anoxinon.me (win 2)

Same for private chats and regular chats.
And several other kinds of notifications.

If we only receive notifications from a chat window it would be nice to
also clear the hilight on the console window since we already catched up
by reading the actual message in the chat window.

Probably not the best description :-) I hope you get it..

Regards https://github.com/profanity-im/profanity/issues/1399
2020-07-09 15:44:35 +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
914c6752dd Fix reading/writing linked files
"base" was not really base but the filename :-)

Fix https://github.com/profanity-im/profanity/issues/1362
2020-06-13 15:02:43 +02:00
Michael Vetter
180ec2b474 Add to_jid field to ProfMessage struct
Is usefult in many cases if we want cleaner code.
Hope this edit didn't break anything though ;-)
2020-04-11 17:11:53 +02:00
Michael Vetter
1f8b1eb740 Allow utf8 symbols as omemo/pgp/otr indicator char
Fix https://github.com/profanity-im/profanity/issues/1264
2020-02-20 23:36:10 +01: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
57ebb7cfa6 Destroy hash table ein autocompleters_destroy()
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:29:35 +02:00
Michael Vetter
d43bd8f253 Add comment about dead assignment in callback_add_timed 2019-08-23 10:13:45 +02:00
Michael Vetter
e75cc41164 Fix double initialization of loop iterator 2019-07-22 14:02:33 +02:00
Paul Fariello
f831f65737 Rename prof_message_t into ProfMessage 2019-06-20 14:30:45 +02:00
Paul Fariello
44d16e9141 Add prof_message_t to wrap all message attributes
Probably missing copy of body to plain in carbon and privmessage.
Only covers the incoming message path because goal is OMEMO decryption
of untrusted message.
Cover some of the log functions but not all.
2019-06-20 14:30:42 +02:00
Michael Vetter
cc697de051 Improve plugin load/install failure message
In case Python or C plugins are disabled install/load failed silently.
Notify the user that we can't load them because profanity was built
without support for plugins.
2019-06-07 11:30:46 +02:00
Paul Fariello
810ea32223 Follow normal workflow for OMEMO message reception
We try to decrypt all messages, if it's successful we use
sv_ev_incoming_message even for OMEMO messages. We pass an OMEMO
boolean to let UI be aware that message were encrypted.
2019-04-10 16:03:50 +02:00
Michael Vetter
c8f55ed338
Merge pull request #994 from philipflohr/master
Fail plugin unloading if plugin does not exist
2019-02-20 10:31:34 +01:00
Michael Vetter
fbbf920e2a
Merge pull request #995 from philipflohr/plugins_unload_all
let plugins_unload_all fail if one plugin unload operation fails
2019-02-20 10:22:49 +01:00
Philip Flohr
d1c54e9aaa Fail plugin unload operation if plugin does not exist 2019-02-20 10:21:17 +01:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
Philip Flohr
054267d738 Fix extended plugin handling PR
Fixes problems found in PR #999
2018-09-06 19:54:29 +03:00
Philip Flohr
cd86f5bc28 added the possibility to uninstall a plugin 2018-09-06 19:28:02 +03:00
Philip Flohr
e4ddced420 use gio functions for file copy 2018-09-06 19:28:02 +03:00
Philip Flohr
2795dc487c removed unreachable code: if plugin is loaded it is also installed and therefore installation will fail. -> The unload code is not needed 2018-09-06 19:28:02 +03:00
Philip Flohr
1f66c08567 provide feedback on failure cause if plugin installation fails 2018-09-06 19:28:02 +03:00
Philip Flohr
adb4955c34 Fail plugin installation if the target file already exists 2018-09-06 19:28:02 +03:00
Philip Flohr
7861c8c03c plugins_unload_all fails if one plugin unload operation fails 2018-04-21 16:47:58 +02:00
James Booth
59382984c0 Add preferences for tab display 2018-03-09 21:15:27 +00:00
James Booth
119c5650cf Show name in statusbar tabs WIP 2018-03-08 20:01:36 +00:00
James Booth
250e972b7a Update copyright 2018-01-21 15:00:02 +00:00
James Booth
17b4e45c57 Show Python version on --version
issue #956
2017-08-10 22:17:05 +01:00
James Booth
6b830277a6 Allow previous autocompletion with shift tab 2017-04-01 00:27:11 +01:00
James Booth
286fecf38d Allow installing plugins from directory 2017-02-05 21:09:03 +00:00
James Booth
dd42c3de6a Allow loading all plugins 2017-02-05 19:16:14 +00:00
James Booth
a9fab9ed2d Allow unloading all plugins 2017-02-05 18:54:33 +00:00
James Booth
68a3daedb9 Update Copyright 2017-01-28 17:24:22 +00:00
James Booth
83385cdbc0 Add pre chat and room message blocking 2017-01-22 18:09:04 +00:00
James Booth
7090f85d85 Add chat and room show calls to plugins api 2017-01-21 20:23:28 +00:00