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

495 Commits

Author SHA1 Message Date
Steffen Jaeckel
b1b6c6f62d add /strophe command to modify libstrophe-specific settings
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 17:04:41 +01:00
Michael Vetter
3adc399da0 Update copyright year 2023-01-10 10:37:25 +01:00
Marouane L
f934c5b59f
Add vCard support
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)
2022-10-18 23:24:30 +01:00
Marouane L
2d11a35ee1 Spawn external programs asynchronously
Drawback is that we can't check the exitcode anymore.
But we were unsure why/when we need this, see:
https://github.com/profanity-im/profanity/pull/1760/files#r980868708

Fixes https://github.com/profanity-im/profanity/issues/1759
2022-10-12 12:25:00 +02:00
Viachaslau Khalikin
0cb46460b3
fix: print when no plugins installed
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-20 04:30:11 +03:00
Viachaslau Khalikin
0ceb8c53c3
fix: filtering of the available global plugins
For command /plugins :
Don't print files that do not correspond to the plugins design

Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-20 01:46:51 +03:00
Viachaslau Khalikin
cc7231a43b
minor: using cons_bad_cmd_usage() instead of the manual handling
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-19 18:08:54 +03:00
Viachaslau Khalikin
45fa60e7e2
Print unloaded plugins which already installed
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-19 00:29:24 +03:00
Viachaslau Khalikin
dd1a9a1e50
Fix handle cmd_plugins_uninstall without args
Signed-off-by: Viachaslau Khalikin <viachaslau.vinegret@outlook.com>
2022-09-19 00:12:49 +03:00
Netboy3
4ea98c71ee Fix /autoaway command logic
Two issues were fixed in the parser logic:
* A call to cons_bad_cmd_usage() was placed at the end of the "time"
  parser section that blocked reachability to both "message" and
  "check" parser sections. This caused "/autoaway message ..." and
  "/autoaway check ..." to always fail with "Invalid usage". This
  issue was introduced in commit 3c1e4ba.
* "/autoaway message xa" with no message argument returns message
  set to (null). This should be fixed the same way as
  "/autoaway message away" was fixed in commit 3c1e4ba.
2022-07-28 11:48:38 -04:00
Michael Vetter
a40a0f5189 Split ox functions from gpg.c to ox.c 2022-06-29 09:17:15 +02:00
Michael Vetter
3f26dd6be9 Let user change log level while running
`/log level INFO|DEBUG|WARN|ERROR` is now available.
Looks like this solves a TODO (see removed comment in source) from 2013
:-)

Works only with default log file. Not with user provided log file during
start up via the -f parameter.

Fix https://github.com/profanity-im/profanity/issues/1627
2022-06-22 12:39:44 +02:00
Michael Vetter
918d060817 Display mood preferences 2022-06-22 11:45:13 +02:00
Michael Vetter
9f13b9e939 Make mood display optional 2022-06-22 11:32:27 +02:00
MarcoPolo-PasTonMolo
e4e53d6e01 Don't forget encryption status for OX and PGP.
Use a pgp.enabled and ox.enabled array the same way that omemo.enabled
is used.

Fixes https://github.com/profanity-im/profanity/issues/1694
Fixes https://github.com/profanity-im/profanity/issues/733
2022-06-17 15:43:54 +03:00
Michael Vetter
2e85f18cd6 Use our omemo sid/fingerprint in qr code
Current clients sid/fingerprint will be shown in following format:
`xmpp:<user@server>?omemo-sid-<numerical-sid>=<omemo-fingerprint-hex-string>`

Fix https://github.com/profanity-im/profanity/issues/1320
2022-05-31 15:44:44 +02:00
swirl
d64cb38240 Reverse QR code colors and add padding
All QR scanners should be able to recognize this, as it is now the
correct color with some padding to prevent blending.

Signed-off-by: swirl <swurl@swurl.xyz>
2022-05-30 18:04:42 +02:00
swirl
9a9a97868d implement working OMEMO QR code
TODO: We need to find a way to switch the colors of the QR code, so that
more QR readers can detect it, without "blending" the edges of the QR
code with the surrounding terminal window.

Signed-off-by: swirl <swurl@swurl.xyz>
2022-05-30 18:04:42 +02:00
Michael Vetter
cf83976b51 Add basic qrcode functions 2022-05-30 18:04:36 +02:00
Michael Vetter
d510f3a430 Final touches for /avatar set 2022-05-27 10:46:36 +02:00
MarcoPolo-PasTonMolo
0cff111249 Add checks for whether gdk-pixbuf exists before using avatar set 2022-05-26 21:06:27 +03:00
MarcoPolo-PasTonMolo
6a44e18853 Add /avatar set command to publish avatar
Use `/avatar set <path>` where <path> is an image file to upload a new
avatar for the current user. When the avatar is too big it gets scaled
down. Scaling code copied from dino.

Fixes https://github.com/profanity-im/profanity/issues/1687
2022-05-26 17:49:34 +03:00
Michael Vetter
1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
Michael Vetter
b16bdca726 ox: show ox preferences 2022-05-05 23:55:31 +02:00
Michael Vetter
d011d6707c ox: Add /ox log command 2022-05-05 23:41:45 +02:00
Michael Vetter
acedd42d78 ox: print message when /ox end is run but not started 2022-05-04 00:03:45 +02:00
Michael Vetter
e5998fb63e ox: implement /ox end
We also need to be able to stop an ox conversation :-)
2022-05-03 18:54:20 +02:00
Michael Vetter
27f25172e9
Merge branch 'master' into add_stamp_settings 2022-04-28 19:33:23 +02:00
Michael Vetter
0dd0193eba use more standard replies when setting stamp 2022-04-28 19:31:27 +02:00
Michael Vetter
6c5d983f13 Rename stamp preference variable
PREF_INCOMING_STR -> PREF_INCOMING_STAMP
PREF_OUTGOING_STR -> PREF_OUTGOING_STAMP
2022-04-28 19:29:27 +02:00
Michael Vetter
066df7f741
Merge pull request #1697 from cockroach/feature/offline-muc-notifications
Add support for offline MUC notifications
2022-04-28 18:32:26 +02:00
Michael Vetter
866f688621 ox: print bad usage instead of custom message 2022-04-27 16:13:05 +02:00
Michael Vetter
ecafb6deaf Remove comment 2022-04-27 16:08:39 +02:00
Stefan Ott
8044c82614 Add support for offline MUC notifications 2022-04-23 02:42:23 +02:00
Paul Fertser
b00e74f3b8 Allow /editor while not connected
Since /editor can be used also for commands it doesn't make sense to
restrict it to only connected state.
2022-04-12 11:42:50 +03:00
Artjom Vejsel
2c003dd2e1 add /stamp command
command allow override standard stamps of incoming and outgoing messages
2022-04-02 00:23:08 +03:00
Steffen Jaeckel
f284641710 less duplication
Print error message from `_string_matches_one_of()` instead of forming
an error message manually that contains the same entries that were checked
in `_string_matches_one_of()`.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-31 14:29:56 +02:00
Steffen Jaeckel
c53b78ea1c use _string_matches_one_of() at more places
I missed them the last time ...

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-31 10:33:14 +02:00
Steffen Jaeckel
2995fbb953 add _string_matches_one_of() helper function
... instead of copying the same pattern over and over again.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-30 18:26:10 +02:00
MarcoPolo-PasTonMolo
03f8db9658 Add none option for /who
Fixes https://github.com/profanity-im/profanity/issues/1425
`/who none` now displays all users in an muc without an affiliation
2022-03-27 16:06:29 +03:00
Michael Vetter
409268e2b6
Merge pull request #1655 from profanity-im/win-autocomplete
Reset url autocompletion after open/save
2022-03-24 20:30:40 +01:00
Michael Vetter
923af3ba38 Reset url autocompletion after open/save
I guess we should reset the position after we ran `/url open|save`.
So that next time `/url open <tab>` starts with the latest entry.

Fix https://github.com/profanity-im/profanity/issues/1654
2022-03-24 15:39:58 +01:00
Steffen Jaeckel
7f1f9787cb add profanity-specific CAfile
The profanity-internal mechanism to allow connecting to a server isn't
easily portable to cURL. Therefor introduce a profanity-specific CAfile
which is managed individually and will be configured in libcurl calls.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-22 11:44:01 +01:00
Michael Vetter
024694215d
Merge pull request #1644 from profanity-im/ox-polish
Improve OX user experience
2022-03-21 10:08:13 +01:00
MarcoPolo-PasTonMolo
3f78af2591 Move get_message_from_editor to appropriate file and change its keybinding 2022-03-03 12:56:03 +01:00
MarcoPolo-PasTonMolo
0fdaad7cbf Add hotkey for sending readline text to editor 2022-03-03 12:55:57 +01:00
Michael Vetter
b8711d5627 Add /subject editor command
Allow editing the MUC subject using external editor.

Use `/subject editor`.

Fix https://github.com/profanity-im/profanity/issues/1638
2022-02-26 10:10:33 +01:00
Michael Vetter
62eedb1cd5 Fix memleak in cmd_export 2022-02-24 12:02:13 +01:00
Michael Vetter
6d17b36605 ox: expand file and check for existance before trying to announce
Output before:
```
11:00:00 - Annonuce OpenPGP Key for OX ~/test/testuser.pub.gpg ...
```

After:
```
11:00:00 - Annonuce OpenPGP Key for OX /home/user/test/testuser.pub.gpg ...
```

Now we expand the path so that we can check for `~` properly.
And test if the file is actually a normal file.
2022-02-24 11:57:25 +01:00
Michael Vetter
57fb10f0bf Fix typos in comments 2022-02-18 18:59:32 +01:00
Steffen Jaeckel
9cf78e59d5 auto-format
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-02-01 15:01:28 +01:00
Michael Vetter
e31e2877fc command: change user mood clearing message 2022-02-01 00:03:13 +01:00
Michael Vetter
af7a4257f5 command: rename /mood clean to /mood clear
As per suggestion of @mdosch.
2022-02-01 00:00:32 +01:00
Stefan Kropp
7a4cfc14d1 XEP-0107: User Mood - Clean mood
* Bugfix in mood_autocomplete (wrong parameter)
 * Implemented /mood clean
 ______________________________________
/ Profanity! THE XMPP client with mood \
\ support!                             /
 --------------------------------------
   \
    \
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\
    \___)=(___/
2022-01-30 18:14:03 +01:00
DebXWoody
2f3de0eb0d xep-0107: code review
* Remarks in the Merge Request (ac_reset, help)
* Defines in iq.c
* Mood help and null check
* Added additional information about tab key in CMD_DESC.
* Added additional null check
2021-12-06 13:33:21 +01:00
DebXWoody
23e886ed5e Add xep-0107: User Mood support
Implementation of XEP 0107 - User Mood
2021-12-06 13:32:54 +01:00
Michael Vetter
9a9122c148 Cleanup _get_message_from_editor a bit
* Fix `src/command/cmd_funcs.c:9463:9: error: ignoring return value of
  ‘write’ declared with attribute ‘warn_unused_result’
  [-Werror=unused-result]`
* Free memory earlier and on less places
* Check for succesful open() and write()
2021-11-01 12:24:28 +01:00
nlfx
c41749b124
Fix OMEMO /sendfile on non-glibc systems 2021-11-01 03:59:44 +01:00
Steffen Jaeckel
ffc0b49ab1 first step to remove libmesode
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2021-10-27 22:45:44 +02:00
Michael Vetter
56846a5b77
Merge pull request #1607 from profanity-im/utf8indicatorchar
Allow more UI indicator signs to be utf8 "characters"
2021-10-22 17:08:14 +02:00
Michael Vetter
a9bcc8e8bd Allow utf8 in occupants header char 2021-10-22 16:54:05 +02:00
Michael Vetter
1c96115f97 Allow utf8 in occupants char 2021-10-22 16:54:05 +02:00
Michael Vetter
fa2881fcea Allow utf8 in roster room private char 2021-10-22 16:54:05 +02:00
Michael Vetter
8fc359ba2d Allow utf8 in roster rooms char 2021-10-22 16:54:05 +02:00
Michael Vetter
7faf15a18c Allow utf8 in roster private char 2021-10-22 16:54:05 +02:00
Michael Vetter
83ee4a27cb Allow utf8 in roster resource char 2021-10-22 16:54:02 +02:00
Michael Vetter
a668ca45b7 Allow utf8 in roster contact char 2021-10-22 16:23:18 +02:00
Michael Vetter
59063aa3b4
Merge pull request #1601 from MarcoPolo-PasTonMolo/master
Add /correct-editor command
2021-10-22 12:38:39 +02:00
MarcoPolo-PasTonMolo
da3a6d8743 Move declaration and definition of win_get_last_sent_message to the correct place 2021-10-22 10:24:51 +03:00
MarcoPolo-PasTonMolo
6b0f15a1c9 Remove autocomplete for /correct-editor
We decided that it was better to remove autocomplete for this command,
since adding it only introduced problems and the command can still
function perfectly without autocomplete.
2021-10-21 17:21:00 +03:00
Michael Vetter
91898597dd Allow utf8 in roster header char
This and the following commits should make a couple of more configs
allow utf8 chars so people can use their weird icons :-)

We did the same for the otr/omemo/pgp indicators at:
1f8b1eb740
5cf6ee1bc6
2021-10-21 15:30:01 +02:00
MarcoPolo-PasTonMolo
cd16264d2b Export common code to helper functions 2021-10-17 20:31:36 +03:00
Michael Vetter
46c8245af9 Format new register code correctly 2021-10-13 21:32:44 +02:00
Michael Vetter
e0e45b7b24
Merge pull request #1574 from binex-dsk/master
Add in-band account registration
Fix https://github.com/profanity-im/profanity/issues/199
2021-10-13 21:19:22 +02:00
MarcoPolo-PasTonMolo
09f5cadf1a Add /correct-editor command 2021-10-07 15:53:12 +03:00
Michael Vetter
f21595597f Format code correctly 2021-10-05 10:01:27 +02:00
Michael Vetter
3120636367 Add more help about how to use plugins
`/plugins install` installs a plugin to
`.local/share/profanity/plugins`.
And also loads it.
When a plugin is loaded it will automatically be added to the `profrc`
file like this:

```
[plugins]
load=my.py;
```

On the next start Profanity will try to load this plugin again unless
`/plugin unload my.py` is called.
2021-09-29 17:32:54 +02:00
Michael Vetter
b0e0012c22 Fix /plugins update ~/dir
If `~/dir` exists profanity exits for me.
Whole code for updating plugins from a dir isn't even implemented. Even
though some messgages suggest otherwise.

Remove this and only allow updating of one file.
2021-09-29 17:32:54 +02:00
Michael Vetter
25820235fe List globally available plugins
Packagers can package https://github.com/profanity-im/profanity-plugins
or another collection of plugins to `/usr/local/share/profanity/plugins`
(python) and `/usr/local/lib64/profanity`  (c).
`/plugins` will list these globally available plugins now along with the
ones thare are installed (`~/.local/share/profanity/plugins`) and loaded.

Regards https://github.com/profanity-im/profanity/issues/945
2021-09-29 17:32:54 +02:00
Michael Vetter
7486e22b77 Look for plugins to install in global location
Two options to install plugins.
Mention the whole path:
`/plugins install ~/src/profanity-plugins/my.py`

Mention only the plugin name:
`/plugins install my.py`

The latter will look in `/usr/local/share/profanity/plugins/` for the
file and copy it over to `~/.local/share/profanity/plugins`.

At first I was thinking about loading the plugins from the global
location. But users most likely don't want to have all plugins activated
that an admin installs on a system.

Regards https://github.com/profanity-im/profanity/issues/945
2021-09-29 17:32:54 +02:00
Michael Vetter
3b3a6b7a75 Remove /python sourcepath
I feel like this mostly is confusing people.
Also don't see much value for it.

To me it looks like a regular workflow is like:
```
/plugin install ~/src/profanity-plugins/my.py
```

The whole thing with sourcepath, install (which also loads without
having that described anywhere), load etc is confusing.
Also each plugin file that is present in
`.local/share/profanity/plugins` will then be auto loaded. Which means
after installation.
2021-09-29 15:49:05 +02:00
Michael Vetter
1dbe1a33b4 cmd_funcs: Use glib function 2021-09-09 09:53:23 +02:00
swirl
87d2c95c87 registration: remove auth param and excess functions 2021-08-17 14:09:48 -04:00
swirl
8a6f1b52d7 progress on fixing registration
doesnt segfault on register, but aborts when you type after registering

need to find a way to disconnect later
2021-08-17 14:09:48 -04:00
swirl
4d3f26154e hacky fix(?) for register
very bad and spaghetti will fix later
2021-08-17 14:09:48 -04:00
swirl
2cc354b6ae fixed some bugs, added some more
- Added JABBER_RAW_CONNECT[ING/ED] connection states
- Added cl_ev_connect_raw and session_connect_raw to conform to normal
connection functions
- Fixed SIGABRT during registration
- Added a check in cmd_register to ensure it's actually connected before
registering--but this will always fail atm
2021-08-17 14:09:48 -04:00
swirl
5ea1ccbb46 /register: parameter updates
add auth param, switch host and username params, rename host param to server
2021-08-17 14:09:48 -04:00
swirl
d9366a26d6 initial register command test 2021-08-17 14:09:48 -04:00
Michael Vetter
20e1f16b1f Fix segfault in /blocked with no args
Fix https://github.com/profanity-im/profanity/issues/1575
2021-07-06 10:21:26 +02:00
Michael Vetter
2cbea9daad cmd_blocked: Exit when wrong arguments 2021-07-02 08:36:51 +02:00
Thorben Günther
34b5e0f8c6
Initialize jid 2021-07-01 21:32:23 +02:00
Michael Vetter
e4a62f3958 XEP-0377: Fix arg parsing 2021-07-01 20:43:17 +02:00
Michael Vetter
3a9cffe013
Merge pull request #1566 from DebXWoody/bugfixing/ox
Bugfixes for OX implementation
2021-07-01 18:26:06 +02:00
DebXWoody
d01ba72535
OX bug fix
* Help / message description
 * C-Code format
2021-07-01 18:08:40 +02:00
Michael Vetter
06482fdaef Add option to only allow messages from jids in roster
`/silence on` will throw away all messages (type: chat, normal) that
come from jids that are not in the roster.

Implement https://github.com/profanity-im/profanity/issues/955
2021-07-01 18:02:03 +02:00
Michael Vetter
1d845c9ffb Reorder /blocked commands
Instead of `/blocked add [<jid>] [report-abuse|report-spam [<message>]`
have:
* /blocked add [<jid>] [<message>] (like before)
* /blocked report-abuse [<jid>] [<message>]
* /blocked report-spam [<jid>] [<message>]
2021-07-01 17:02:39 +02:00
Michael Vetter
7f737a3b47 Mention feature details when not supported
So that we will get aware of a version mismatch.
2021-07-01 10:36:52 +02:00
Michael Vetter
31ebd6ab1c Add XEP-0377: Spam Reporting
Report and block:
`/blocked add someone@domain.org report-abuse This is not nice`
`/blocked add someone@domain.org report-spam This is not nice`

Regular block:
`/blocked add someone@domain.org`

Implement https://github.com/profanity-im/profanity/issues/1434
2021-07-01 00:14:32 +02:00
DebXWoody
2a011e69ac
Bugfixes for OX implementation
* autocomplete for /ox discover
 * fixed help description
 * Implemented /ox char command
 * Validated KeyID length
2021-06-28 21:28:58 +02:00
Michael Vetter
a4deec8b8d editor: dont print preview in window
See https://github.com/profanity-im/profanity/issues/1521#issue-860017824
2021-06-10 16:57:18 +02:00