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

371 Commits

Author SHA1 Message Date
Maximilian Wuttke
e8664e2730 OMEMO: Fail if message keys couldn't be encrypted for any recipient device
If the message (key) can't be encrypted for any device, sending the
message is refused and an informative error message is presented to the
user.

Also, don't encrypt for the same device, since the OMEMO XEP disallows
this.
2021-04-08 00:29:58 +02:00
Maximilian Wuttke
9e0d0ed466 OMEMO: Remove duplicate session initalisation
The function `omemo_start_session` was effectively called twice in the
`/msg` command: Once in `chatwin_new` and afterwards in `cmd_msg`. I've
removed the second call.
2021-04-08 00:23:07 +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
3c1e4bac3a Fix segfault in cmd_autoaway()
Two mistakes were here:
* `/autoaway time away` without a time argument segfaulted
* `/autoaway message away` without a mesage set to (null). We have
  `/autoaway message off to set it off.

Also use g_strcmp0() instead of strcmp().
2021-03-29 10:48:42 +02:00
Michael Vetter
fde0a0d1c6 Add support to register with a room
`/affiliation register` can now be used to register a nickname with a
MUC.

Tested with a server without forms. Couldn't find a server which
supports forms yet.

Implements https://github.com/profanity-im/profanity/issues/1210
2021-03-25 11:05:58 +01:00
Thorben Günther
ec6f9df486
MUC: Add voice request
closes https://github.com/profanity-im/profanity/issues/1211
2021-03-12 14:57:00 +01:00
Michael Vetter
cb0adae63a Dont build paths manually in cmd_funcs.c
Some time ago we introduced get_expanded_path().
No need to build paths manually anymore to get ~.
2021-03-12 10:29:06 +01:00
Thorben Günther
b0aea2bcff
Add command to change password of logged in user 2021-03-11 17:42:53 +01:00
Thorben Günther
71236a0d5a
Update ui_ask_password to support confirmation
Just prints a different string to console.
Useful for changing passwords or account registration.
2021-03-11 14:40:17 +01:00
Thorben Günther
f1780f0017
MUC: Show offline members in sidebar 2021-03-08 14:34:59 +01:00
Michael Vetter
44fc3f0506 Add /mam command
Regards https://github.com/profanity-im/profanity/issues/660
2021-01-28 15:11:50 +01:00
Michael Vetter
6a17e9d50e Dont reload theme when disconnecting on purpose
I don't see why would need to.
Also this only happens upon `/disconnect` not on a network outage or
server related disconnect.

Fixes https://github.com/profanity-im/profanity/issues/1472
2021-01-22 13:17:49 +01:00
Michael Vetter
1038b97a7d Fix old chlog reference in help
Fixes https://github.com/profanity-im/profanity/issues/1470
2021-01-17 11:31:05 +01:00
William Wennerström
01e8f01ed3
Add /executable (urlsave|urlopen) migrations 2020-12-18 16:05:11 +01:00
Michael Vetter
47a447bf73 Shared log file needs a restart
Tell user about this change.
2020-12-11 11:17:44 +01:00
William Wennerström
e70c64b74a
Create download directory under XDG data path
* If the downloads directory does not exist, create it.
 * Change some cons_show to cons_show_error (because they log errors).
2020-12-10 19:04:32 +01:00
William Wennerström
a1486012d2
Fix build failure (unused variable) 2020-12-09 19:37:35 +01:00
William Wennerström
00dbc1ba7c
Cast chat/muc window to correct type and refactor cmd_sendfile
Fixes #1449
2020-12-09 19:02:37 +01:00
Michael Vetter
55f09b6152 Use get_expanded_path() in cmd_senfile() 2020-12-09 08:44:44 +01:00
William Wennerström
d7848e38bc
Remove scheme and filetype matching for url (save|open) 2020-12-08 20:01:17 +01:00
William Wennerström
332dc87ca5
Fix wrong order of arguments for _url_http_method 2020-12-07 16:38:05 +01:00
William Wennerström
867d895469
Add tests for format_call_external_argv 2020-12-07 16:16:15 +01:00
William Wennerström
4a1c118b8b
Fix bad order of parameters for url save 2020-12-07 15:15:06 +01:00
William Wennerström
ac03037847
Rework url to filename 2020-12-06 17:02:09 +01:00
William Wennerström
1d2c0a8836
Move unique_filename_from_url functions to common 2020-12-04 16:13:13 +01:00
William Wennerström
3a6597ee29
Refactor for threaded external executable for built-in download methods 2020-12-03 16:54:06 +01:00
William Wennerström
be62b446f7
Add stubs 2020-11-16 21:58:10 +01:00
William Wennerström
ab83afe21b
Switch to g_strerror 2020-11-16 21:58:09 +01:00
William Wennerström
62cbad1c6e
Add I/O error handling and use filenames instead of file descriptors 2020-11-16 21:58:09 +01:00
William Wennerström
73f313b921
Refactor OMEMO download into AESGCMDownload tool 2020-11-16 21:58:09 +01:00
William Wennerström
fb002a59b6
Use fallback method when /executable urlsave is unset 2020-11-16 21:58:09 +01:00
William Wennerström
4711fc62a3
Run make format on rebase 2020-11-16 21:58:09 +01:00
William Wennerström
a0cf0844ab
Remove unsafe Conent-Disposition inferring 2020-11-16 21:58:09 +01:00
William Wennerström
eebf54c859
Infer filename from content-disposition or URL
The Content-Disposition inferring is probably a bad idea security wise,
so I am going to remove it.
2020-11-16 21:58:09 +01:00
William Wennerström
9499df6585
Add http_download tool 2020-11-16 21:58:09 +01:00
William Wennerström
362c6973de
Wording 2020-11-16 21:58:08 +01:00
William Wennerström
04bfa23ead
Remove temporary ciphertext file when finished 2020-11-16 21:58:08 +01:00
William Wennerström
9d58472c8c
Remove /omemo sendfile 2020-11-16 21:58:08 +01:00
William Wennerström
f4ab1ca9e7
Move file encryption function to public header 2020-11-16 21:58:08 +01:00
William Wennerström
e98644f631
Add guards for OMEMO 2020-11-16 21:58:08 +01:00
William Wennerström
fc6136ddf0
Remove unused #define's and move URL scheme define to omemo/crypto.h 2020-11-16 21:58:08 +01:00
William Wennerström
d5b1dc0eb6
Move setup for AESGCM to omemo/crypto 2020-11-16 21:58:08 +01:00
William Wennerström
e9d5875782
Reformat HTTP get URL to AESGCM scheme 2020-11-16 21:58:08 +01:00
William Wennerström
39c3290613
Refactor to use file stream 2020-11-16 21:58:08 +01:00
William Wennerström
3370418d71
Initial /sendfile OMEMO encryption 2020-11-16 21:58:07 +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
a5ca65453e Fix lastactivity behaviour
Autocomplete only completed on|off.

Now:

`/lastactivity get` -> get server uptime
`/lastactivity get <jid>` -> get user lastactivity
`/lastactivity set on` -> enable for self
`/lastactivity set off` -> disable for self

Fix https://github.com/profanity-im/profanity/issues/1411
2020-07-22 13:13:30 +02:00
Michael Vetter
39315483a8 Remove /tiny command
boothj5 gave his okay too.

Fix https://github.com/profanity-im/profanity/issues/1370
2020-07-10 17:48:34 +02:00
Michael Vetter
29130e9293 Add forgotten file..
Belongs to 95ab7ee062
2020-07-10 15:19:48 +02:00
Michael Vetter
95ab7ee062 Setting: only write in console upon muc mention
`/console muc mention` additionally to `first|none|all`.

Fix https://github.com/profanity-im/profanity/issues/1371
2020-07-10 15:16:34 +02:00
Michael Vetter
10d771f3d1 Merge branch 'master' of github.com:profanity-im/profanity 2020-07-10 13:46:06 +02:00
DebXWoody
0552e50c78 OX: XEP-0373: OpenPGP for XMPP - Version 0.5.0 (2020-06-19)
Discovering Public Keys via PEP

* 4.3 Discovering Public Keys of a User
* 4.4 Requesting Public Keys

* Import Public Keys into GnuPG's local keyring.

Issue: #1331
2020-07-10 13:40:00 +02: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
DebXWoody
5a17957253 OX: Announce public key on PEP
src/pgp/gpg.c:p_ox_gpg_readkey

Used to read a public key from a file. The function will return the fingerprint
of the file and the base64 encoded key.

src/xmpp/ox.[hc]

ox_announce_public_key(const char* const filename) can be called from the /ox
announce <filename> command. The key within the file will be pushed on PEP and
the Metadata node will be set.

Issue: #1331
2020-07-06 13:19:18 +02:00
Michael Vetter
a0e1dfbb87 cmd_funcs.c: Remove not needed variable 2020-07-02 15:00:52 +02:00
Michael Vetter
e5ac12afa6 Remove prefs_free_string()
It just does a free.
Related to b580b9ef11
2020-07-02 11:34:12 +02:00
Michael Vetter
9774b0c550
Merge pull request #1374 from profanity-im/revampUrlopen
Rework /url and /executable for filetypes
2020-07-02 11:26:18 +02:00
Michael Vetter
59f5b81b85 cmd_url_*(): use gchar instead of char 2020-07-02 10:58:31 +02:00
Michael Vetter
b45384902d cmd_url_open(): fix memleak 2020-07-02 10:10:53 +02:00
Michael Vetter
2fc5a2ee54 cmd_url_*(): remove NULLing when not needed 2020-07-01 17:00:11 +02:00
Michael Vetter
780ee74177 cmd_executable(): Check arg lengths 2020-07-01 16:10:27 +02:00
Michael Vetter
31ec640d05 Fix omemo otr case
Fix 3afd854dc8
2020-06-29 19:13:56 +02:00
DebXWoody
2c94ee5a88 Feature request - XEP-0373: OpenPGP for XMPP (OX)
Basic implementation of XEP-0373: OpenPGP for XMPP.
https://xmpp.org/extensions/xep-0373.html

Command /ox

Issue: #1331
2020-06-29 19:05:41 +02:00
Michael Vetter
3afd854dc8 cmd_funcs: fix omemo case
Small mistake introduced in b7f959bab4.
2020-06-29 16:29:53 +02:00
Michael Vetter
2f4b1734e9 Dont allow starting a PGP session while in an OMEMO session 2020-06-29 15:14:55 +02:00
Pierre Mazière
233494d01e Display a message acknowledging file saving success
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-25 15:03:34 +02:00
Pierre Mazière
c56d530b67 Replace /urlopen with /url and adapt /executable
/urlopen is replaced by /url with the following sub commands:
/url open <url>
/url save <url> [<path>]

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-25 15:03:04 +02:00
Pierre Mazière
96c877de80 Refactor cmd_urlopen
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-25 15:03:01 +02:00
DebXWoody
b7f959bab4
Clean-up: defines cmd_funcs.c 2020-06-20 06:45:40 +02:00
Dmitry Podgorny
ac410445af Add option for legacy authentication
New options:
  /connect <account> [auth default|legacy]
  /account <account> set auth default|legacy

Fixes #1236.
2020-06-05 11:37:51 +03:00
Michael Vetter
140ac99c0c Fix memleak again
Memleak was reinroduced in d92c576aa5
It was already fixed in ac5ce105ac

But the rebase peetahs rebase ontop of master took the wrong changes.

I decided to pull anyways and fix since reviewing/giving feedback
without GH probably takes longer.
2020-06-03 13:21:39 +02:00
Pierre Mazière
d92c576aa5 Get output and error streams from the command spawned by external_call()
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-03 13:09:29 +02:00
Michael Vetter
ac5ce105ac Fix memleak in cmd_urlopen() 2020-05-29 11:32:32 +02:00
Michael Vetter
438552c14c Save bookmark ignore list 2020-05-25 13:49:24 +02:00
Michael Vetter
de8975c008 Add and use connection_get_barejid()
Instead of connection_get_fulljid() and then creating a Jid from it.
2020-05-25 13:04:19 +02:00
Michael Vetter
be4a6cac78 Add bookmark ignore add|remove
Regards https://github.com/profanity-im/profanity/issues/1115
2020-05-24 17:55:15 +02:00
Michael Vetter
f121554088 List ignored bookmarks
`/bookmarl ignore` lists the ignored bookmarks.

Regards https://github.com/profanity-im/profanity/issues/1115
2020-05-24 17:55:08 +02:00
Michael Vetter
88c36745fe Add option to add bookmark name
`/bookmark add|update` got `name` field.
By default localpart of JID is used (like before) but now we can set the
name ourselves.

Regards https://github.com/profanity-im/profanity/issues/697
2020-05-22 14:18:20 +02:00
Michael Vetter
cb78ee4665 Make option to allow hiding windows with no messages in statusbar
`statusbar.show.read` can be set to false in the config.
`/statusbar show|hide read`.

Implement https://github.com/profanity-im/profanity/issues/1285
2020-05-21 16:15:14 +02:00
Michael Vetter
7b541d0a6d Add /executable command
This is used to set the openers for various commands.
So far for /avatar and /urlopen.
2020-05-20 14:14:49 +02:00
Michael Vetter
21cc53bdfd Make urlopen command configurable 2020-05-20 10:54:58 +02:00
Michael Vetter
fc5fa62951 Create call_external() helper function 2020-05-20 10:54:58 +02:00
Michael Vetter
ce32d874e0 Build URL ac upon printing of message in window 2020-05-20 10:54:54 +02:00
Michael Vetter
03334664fb Actually open the URL 2020-05-20 10:47:46 +02:00
Michael Vetter
9c853d9f46 xep-0092: make it possible to ask servers or components for software
This adds the new `/serversoftware` command.

```
/software user@domain.org/resource
/serversoftware domain.org
```

Fix https://github.com/profanity-im/profanity/issues/1338
2020-05-14 19:13:27 +02:00
Michael Vetter
9243655a22 Have proper autocompletion for /software in chat window
In console autocomplete from roster.
In muc autocomplete from occupants lits.
In 1:1 regular chat autocomplete from active resources of currently
selected user (new).

Also give a hint (/help resource) how to set the resource should a user choose that way.

Fix https://github.com/profanity-im/profanity/issues/1337
2020-05-14 18:09:54 +02:00
Michael Vetter
85520ecdc5 Remove unanimous MAM display
For some time users could choose to have the old way "unanimous" where
all the MUC history is just grey (or whatever was set). Now it is always
just displayed like regular new incoming MUC text.
2020-04-25 17:19:02 +02:00
Michael Vetter
5db14b2c48 Fix parsing of alias command
This actually only set the local ran pointer to NULL.
But we want an effect on the outside variable.
2020-04-20 15:54:32 +02:00
Michael Vetter
4fc938d804 Add setting to not colorize own nick according to xep-0392
Some users might want there nick to always stay white (etc) for easier
recognition.

Now we can do `/color own off` to not generate the color based on
xep-0392. The `me=` color (etc) from the theme will then be used.

Once we run this command `theme_load()` is called again.
And the theme looks totally wrong.
We encountered this at other times already and I think it's nothing
wrong with this new code here now but that there seems to be a missing
closing attr for the color when drawing.

Should be investigated seperately.

Fix https://github.com/profanity-im/profanity/issues/1288
2020-03-25 12:54:25 +01:00
Michael Vetter
4c8e78664c Fix old typo in titlebar presence 2020-03-24 22:24:25 +01:00
Michael Vetter
f131680055 titlebar: allow displaying MUC name and MUC jid
`/titlebar use name|jid` -> `/titlebar show|hide name|jid`

Fix https://github.com/profanity-im/profanity/issues/1284
2020-03-24 22:22:16 +01:00
Michael Vetter
3c56b289ed Add slashguard feature
New command `/slashguard` tries to protect against typing ` /quit` by
not allowing a slash in the first 4 characters.
2020-03-18 18:20:05 +01:00
Michael Vetter
52e7e596aa xep-0084/avatar: add option to open avatar directly
Change:
`/avatar me@somewhere.org` -> `/avatar get me@somewhere.org`

New:
`/avatar cmd feh`
`/avatar open me@somewhere.org`

Implement https://github.com/profanity-im/profanity/issues/1281
2020-03-10 07:12:13 +01:00
Michael Vetter
240aeac4d3 Make cmd_logging() safer
Could be that args[1] is not set.
2020-02-25 14:55:46 +01:00
Michael Vetter
55f49f1259 get_log_file_location () should return const char*
Make clear that result should never be freed.
2020-02-21 21:19:54 +01:00
Michael Vetter
669de0ca52 Improve setting encryption char error handling 2020-02-21 14:51:19 +01: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