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

379 Commits

Author SHA1 Message Date
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
Michael Vetter
80dd3fdbb2 Add option to color MUC history like regular messages
`/logging group color` has:
* `unanimous` which will color it with one unanimous color. Like it was
done always.
* `regular` which colors it like regular incoming messages.

Regards https://github.com/profanity-im/profanity/issues/1261
2020-02-20 08:11:58 +01:00
Michael Vetter
7955f44262 Mention how to enable unencrypted file transer
Regards https://github.com/profanity-im/profanity/pull/1270
2020-02-17 08:59:55 +01:00
Michael Vetter
7d596d8cef Make /sendfile in PGP session configurable
`/pgp sendfile on` allows unencrypted file transfer in an PGP session.

Regards https://github.com/profanity-im/profanity/pull/1270
2020-02-17 08:57:35 +01:00
Michael Vetter
86bcadcbe3 Make /sendfile in OTR session configurable
`/otr sendfile on` allows unencrypted file transfer in an OMEMO session.

Regards https://github.com/profanity-im/profanity/pull/1270
2020-02-17 08:51:43 +01:00
Michael Vetter
36713a2ed7 Make /sendfile in OMEMO session configurable
`/omemo sendfile on` allows unencrypted file transfer in an OMEMO
session.

Regards https://github.com/profanity-im/profanity/pull/1270
2020-02-17 08:31:46 +01:00
moppman
674a8aaf7e Disallow sendfile in e2ee chat sessions 2020-02-17 08:02:00 +01:00
Michael Vetter
edba5c83ff xep-0308: only allow /correct when corrections are enabled 2020-02-14 11:18:16 +01:00
Michael Vetter
8f37afcd37 xep-0308: Make /correct work without quotation marks
Now we can specify an unlimited amount of arguments for commands.
Maybe this is also helpful for other commands that use quotation marks
so far.
2020-02-14 10:17:07 +01:00
Michael Vetter
4ec005e4c3 xep-0308: Implement LMC for outgoing MUC messages
Including OMEMO encrypted ones.
Also rename `win_println_me_message()` to `win_print_outgoing_muc_msg()
as I think it's a more descriptive name.
2020-02-14 10:17:07 +01:00
Michael Vetter
7ad2e4761b xep-0308: Don't check whether receiving clients supports this feature
XEP-0308 Version 1.1.0 (2019-05-15) states "It is expected that clients will not send message corrections to clients that do not support them, as non-supporting clients will render these as duplicate (corrected) messages"

```
10:12:47 - jubalh: Do clients actually check whether other clients support xep0308 (LMC) before sending?
10:13:13 - pep.: not poezio, and I doubt anybody does. it's the "but carbons/MAM" argument
10:13:49 - jubalh: Profanity doesnt support this yet. So I always get the message twice. One time the message, and then the corrected ones. And I think that's right. But I understood xep0308 correctly it sais a
           client shouldnt sent a message with 'replace' if the client doesnt support it? I don't see why
10:14:50 - Ge0rG: jubalh: because you might also use Conversations and read the backlog from MAM on conversations
10:15:51 - jubalh: Ge0rG: sorry?
10:16:36 - Ge0rG: jubalh: when I'm sending you a message, I don't know which client you'll use to read it. So it doesn't make sense to limit the features I use
10:27:57 - jubalh: Yes. That's why I'm confused by thestatement in the XEP
10:28:13 - jubalh: "It is expected that clients will not send message corrections to clients that do not support them, as non-supporting clients will render these as duplicate (corrected) messages. "
10:28:37 - Holger: Yes, you're both saying the same thing.  And yes I agree, that part of the XEP is nonsense.  We have that "check whether the peer's client supports it" stuff in various XEPs that depend on
           recipient's features and it never makes sense as it doesn't cope with multi-device, MAM, groupchat.
10:28:53 - jubalh: First: You don't know if he is connected with several clients. Some supporting it and some not. Second: Why not just resend the new corrected message? Then he has both messages and no
           information is lost. If he only gets the first one information is lost
10:29:20 - jubalh: Okay
10:29:30 - jubalh: Then I won't implement it this way. Thanks guys!
10:29:34 - Holger: Well UX is a bit meh if the recipient doesn't support it (I'm an MCabber user and know what I'm talking about) but I see no better solution, yes.
```

So it makes more sense to just always send it. Non supporting clients will then get the message and the corrected message. So they get it "twice". Which is the right thing to do in my opinion.
2020-02-12 10:31:12 +01:00
Michael Vetter
11b6e1bfa0 xep-0308: enable corrections for outgoing encrypted messages 2020-02-12 08:54:12 +01:00
Michael Vetter
b6b7dd5ad4 xep-0308: update the UI upon sending a corrected message
So far we don't do this for encrypted messages. Still needs to be done.
And MUC also needs to be done.
2020-02-11 15:26:58 +01:00
Michael Vetter
1118110071 xep-0308: Implement /correct to correct the last send message
So far the correction is sent. But the UI in Profanity itself is not
updated.

Also autocompletion for `/correct` with the last sent message is
missing.
2020-02-10 16:17:01 +01:00
Michael Vetter
dd8086772d xep-0308: create setting to toggle lmc
and print settings if only `/correction` is run.
2020-02-10 14:52:42 +01:00
Michael Vetter
c2d70a071f xep-0308: set correction char in config 2020-02-10 13:48:31 +01:00
Michael Vetter
cd80b6cbf2 Change theme handling
So far when loading a theme it also overwrote the preferences the user
set.

Lengthy discussion can be found at
https://github.com/profanity-im/profanity/issues/1077

Now we use `/theme load themename` to load the [colours] part of a
themem only.

`/theme full-load themename` will load the complete theme including
preferences set in there.

Regards https://github.com/profanity-im/profanity/issues/1077
2020-01-29 12:33:55 +01:00
Michael Vetter
4bc82a5318 XEP-0092: Add configuration option to choose whether to send OS name
`/os on|off` now let's one choose whether to include the OS name once
`/software` (XEP-0092) is ran on us.
2020-01-24 19:27:42 +01:00
Michael Vetter
56b7482b08 Add option to display MUC name or JID in titlebar
Add `/titlebar use [name|jid]`.
2020-01-23 19:42:22 +01:00
Michael Vetter
9e35861001 Add /roster room use command
`/roster room use name` to use the name of the MUC in the roster list.
`/roster room use jid` to use the jid of the MUC in the roster list.

Display it only in case `/roster room by none` is set so far.
2020-01-23 16:50:43 +01:00
Paul Fariello
84506cbaeb Use OMEMO for offline MUC members (#1242) 2020-01-20 14:28:13 +01:00
Daniel Lublin
4420463541 Refactor /roster show/hide (#1251)
Refactor /roster show/hide
2020-01-12 22:02:32 +01:00
Michael Vetter
1f809e5210 Refactor _cmd_set_boolean_preference
Only compute string if necessary.
2019-12-19 19:25:58 +01:00
Michael Vetter
808850c6f5 Add /occupants color command
`/occupants color on|off` to enable or disable XEP-0392 also for the
MUC occupants.

Regards
https://github.com/profanity-im/profanity/issues/1191
2019-12-19 19:14:59 +01:00
Michael Vetter
0af54d8a72 Add /roster color command
`/roster color on|off` to enable or disable XEP-0392 also for the
roster.

Regards https://github.com/profanity-im/profanity/issues/1191
2019-12-19 18:53:22 +01:00
Michael Vetter
e3538cf739 xep-0084: Look for specific user and print ID
Add a `/avatar` command.
2019-12-18 11:24:50 +01:00
Michael Vetter
2750194279 Implement Color Vision Deficiencies setting
Implement settings for redgreen and blue blindness.

Regards https://github.com/profanity-im/profanity/issues/1191
2019-12-12 11:07:11 +01:00
Michael Vetter
ddf6ada3d1 Add initial support for XEP-0392
The last 3 commits added basic support.
Thanks @aaptel!

This commit adds basic settings interface to use it.
See `/color on|off`.

We still have to enable settings for color blindness.
And maybe another setting to decide whether to color the
occupantslist/roster with the same algo.

Regards https://github.com/profanity-im/profanity/issues/1191
2019-12-09 16:12:54 +01:00
Michael Vetter
f0a719d1e1 Merge /group command into /roster
Fix https://github.com/profanity-im/profanity/issues/1229
Regards https://github.com/profanity-im/profanity/issues/1116
2019-11-25 10:40:25 +01:00
Michael Vetter
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
9bc4dc3827 Merge /chlog and /grlog commands into /logging
Instead of `/chlog on` we now have `/logging chat on`.
Instead of `/grlog on` we now have `/logging group on`.

Fix https://github.com/profanity-im/profanity/issues/1224
2019-11-12 12:39:24 +01:00
Michael Vetter
cbd85ffd1a cmd_room: don't check arguments twice 2019-11-08 13:00:31 +01:00
Michael Vetter
b846c4970b Fix setting of status message
Seems this actually never worked.
Now it does.

`/status set online "This is my text"`
`/status set away bye`
`/status set away`
2019-11-07 10:25:31 +01:00
Michael Vetter
ecfa2d0c1b Merge state commands (online, away) into status
Before we had `/online`, `/away`, `/dnd`, `/chat`, `/xa`.
These commands are no longer available.

We have `/status set online` etc now.

Before `/status` was used to get the status of a contact.
This now moved to `/status get`.

Regards https://github.com/profanity-im/profanity/issues/1116
2019-11-06 20:09:34 +01:00
Michael Vetter
c1a9736232 Merge /invite, /invites and /decline commands
`/invite <contact>` became `/invite send <contact>.
`/invites` became `/invite list`.
`/decline` became `/invite decline`.

Accept is still done via `/join`.

Regards https://github.com/profanity-im/profanity/issues/1116
2019-11-05 22:06:19 +01:00
Michael Vetter
40dc5932f7 Add /titlebar show presence command
Additionally to `/presence titlebar on` we now allow the setting via
/titlebar show|hide presence` since it's about the titlebar.

Regards https://github.com/profanity-im/profanity/issues/1116
2019-11-05 21:06:07 +01:00
Michael Vetter
3d272f02bc Add /titlebar show resource command
Additionally to `/resource titlebar on` we now allow the setting via
/titlebar show|hide resource` since it's about the titlebar.

But makes sense to have it in `/resource` too because there is
`/resource message on|off` too. And this one doesnt have an setting of
it's own.

Regards https://github.com/profanity-im/profanity/issues/1116
2019-11-05 20:51:27 +01:00
Michael Vetter
fc6f2755c1 Move /encwarn command into /titlebar
Instead of `/encwarn on|off` we now have `/titlebar show|hide encwarn`.

Regards https://github.com/profanity-im/profanity/issues/1116
2019-11-05 20:39:33 +01:00
Michael Vetter
643d12af44 Move tls show to titlebar command
Previously we had `/tls show on|off` to manipulate the UI setting for
the title bar. To decide whether to show TLS info there or not.

This should go into `/titlebar`.

Now we have `/titlebar show|hide tls` for this.

Regards https://github.com/profanity-im/profanity/issues/1116
2019-11-05 13:48:26 +01:00
Michael Vetter
291f9de1e9 Send clipboard via /paste
New command `/paste` that sends the clipboard in MUC, Chat etc windows.

Fix https://github.com/profanity-im/profanity/issues/156
2019-10-29 15:20:57 +01:00
Michael Vetter
b46dbcc363 Add clipboard feature
Use GTK to take the text from the clipboard.
Add `/paste` command which pastes this text now to console window.
2019-10-29 15:20:57 +01:00
Michael Vetter
f186eb94da Remove not neede free
It's in the def == NULL case. So will always be noop.
2019-10-25 14:06:03 +02:00
Michael Vetter
6a88af6bc6 Remove /leave command
We have `/close` which does the same and more.

Regards https://github.com/profanity-im/profanity/issues/1116
2019-10-22 15:33:54 +02:00
Dmitry Podgorny
6d11cd2db3 Fix memory leak in cmd_join()
room is either argv[0] or allocated by GString. We have to free memory
in the 2nd case. Replace argv[0] with g_strdup(argv[0]) in order to
make unconditional g_free().
2019-10-14 00:19:08 +03:00
Michael Vetter
87b66d0816 Make cmd_account safer 2019-10-10 18:06:28 +02:00
Michael Vetter
7684cf64f0 Revert "Fix memleak in cmd_join"
This reverts commit 1746f5f8a8.
2019-10-06 22:44:35 +02:00
Michael Vetter
1746f5f8a8 Fix memleak in cmd_join
Free `room` string in case we allocated it ourselves.

Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:53:16 +02:00
Michael Vetter
3ce27b47ad Free strings in all cases in cmd_rooms
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:51:04 +02:00
Michael Vetter
10f2715ea9 Free options in error case for cmd_connect()
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:19:17 +02:00
Michael Vetter
684a9b1a56 Add /clear autocompletion and improve help
Regards https://github.com/profanity-im/profanity/issues/855

https://github.com/profanity-im/profanity/pull/874 brought us the
`/clear` command. The author of that patch couldn't follow up with the
review boothj5 did.

So the autocompletion and updated help was missing.
This commit adds it.
2019-10-05 16:19:53 +02:00
Michael Vetter
4637a7a23b Merge remote-tracking branch 'philipflohr/master' 2019-10-05 15:04:46 +02:00
Michael Vetter
5c77b97c35 Introduce /reload command
This command reloads the configuration file.

Fix https://github.com/profanity-im/profanity/issues/627
2019-10-04 14:06:25 +02:00
Michael Vetter
30875a9069 Fix typo conact -> contact 2019-09-29 15:07:32 +02:00
Michael Vetter
a4e9d9b9e2 Use helper function for cmd_status 2019-09-29 15:07:08 +02:00
Michael Vetter
b961ad29c7 Allow pasing a jid to info command in chat window
If we pass a jid/nick to `/info` in a chat window we will still get the
output. But on the console window.

Regards https://github.com/profanity-im/profanity/issues/1194
2019-09-29 15:04:19 +02:00
Michael Vetter
0f732466f8 Allow pasing a jid to status command in chat window
Regards https://github.com/profanity-im/profanity/issues/1194
2019-09-29 14:58:25 +02:00
Michael Vetter
62103665e2 Remove unused code in cmd_room() about win num
There is actually no reason to get the window number here.
2019-08-23 10:04:54 +02:00
Michael Vetter
658e36a066 Add 'save' command to save preferences
Most applications have an 'apply changes' button. This makes testing
easier too.

Implement https://github.com/profanity-im/profanity/issues/1164
2019-08-02 10:23:13 +02:00
Michael Vetter
41b54a5c14 Fix 3 leaks in cmd_funcs 2019-07-22 15:26:32 +02:00
Michael Vetter
16174727f4 Guard against arg being NULL in cmd_funcs
This should actually never happen because we have the mechanism that
checks the commands. But let's do it in case we break something in that
mechanism and to make clang happy.

Fixes clangs: 'Argument with 'nonnull' attribute passed null'
2019-07-22 13:47:52 +02:00
Michael Vetter
04988ab4ba Fix segfault in /cmd exec
Test for correct number of arguments before using argument.
2019-07-12 10:36:17 +02:00
Michael Vetter
ae1e60a9f9 Add option to set all window related time formats
Implements feature requested at: https://github.com/profanity-im/profanity/issues/632

So instead of:

/time console set <format>
/time chat set <format>
/time muc set <format>
/time mucconfig set <format>
/time private set <format>
/time xml set <format>

As a short cut the user can do:

/time all set <format>

Excluding statusbar and lastactivity settings since they are not for main windows, but used slightly differently.
2019-06-17 14:23:33 +02:00
Michael Vetter
9516324248 Refactor cmd_omemo_start
Some code was duplicated/similar.
The parts about using a chatwin while being started from another window
(recipient provided) and being a chatwin were the same.

Like this it should be easier to read and less code.
2019-06-07 21:14:53 +02:00
Michael Vetter
2eb2bf3508 Print omemo start related msgs into correct window
Print them in the window of the contact. Not just the current window.
Fix https://github.com/profanity-im/profanity/issues/1093
2019-06-07 21:14:44 +02:00
Michael Vetter
bee7846ea0
Merge pull request #1121 from profanity-im/feature/notify-plugin-fail
Improve plugin load/install failure message
2019-06-07 12:17:56 +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
Michael Vetter
4e972f8aef Check for sane argument in autoconnect set
Check that user doesnt do `/autoconnect set   `.
Which would result in: `Account '(null)' does not exist`.
2019-06-05 14:41:09 +02:00
Michael Vetter
53ef209272 Check if valid account before setting autoconnect
Fixes https://github.com/profanity-im/profanity/issues/1112
2019-06-05 14:19:41 +02:00
William Wennerström
e07a06d1a2
Force UI update before generating OMEMO crypto materials 2019-05-21 22:32:06 +02:00
Michael Vetter
f082563bf2 Add occupants char
`/occupants char` now sets a character that is displayed before the nick
in MUCs. Similar like `/roster char` is displaying a char for the roster.

Regards #690
2019-05-02 17:01:55 +02:00
Michael Vetter
125ca2f0d2 Add occupants wrap option
Wrapping for the occupants panel like already exists for the roster
panel. See `/occupants wrap on`.

Regards https://github.com/boothj5/profanity/issues/690
2019-04-24 09:49:14 +02:00
Michael Vetter
028839e35a Put occupants update into own function 2019-04-23 14:13:08 +02:00
Michael Vetter
566022786d Add occupants header char
`/occupants header char` now sets a character that is displayed before
the role (moderator, visitor..) in a room. Similar to `/roster header
char` is displaying a char for the roster.

Regards https://github.com/boothj5/profanity/issues/690
2019-04-23 14:13:03 +02:00
Michael Vetter
62c23233f7 Allow setting occupants indent outside of MUC
And when not connected.
2019-04-20 20:35:37 +02:00
Michael Vetter
0c248a0b16 Add /occupants indent command
Roster has a `/roster contact indent` option.
Now we have the same for occupants. So contacts in roster and in MUC can
have configurable indentation.

Regards https://github.com/boothj5/profanity/issues/690
2019-04-18 20:53:02 +02:00
Paul Fariello
5f015e32b2 Add OMEMO policy
There is 3 policy:

- manual: OMEMO session are only started manually
- automatic: OMEMO session are only started if they have been started
  manually before
- always: OMEMO session are always started unless they have been ended
  manually before

Closes #1040 and fixes #1052
2019-04-17 14:03:14 +02:00
Michael Vetter
9574127177
Merge pull request #1066 from paulfariello/hotfix/OMEMO-ensure-muc-is-nonanonymous
Ensure MUC is Non-Anonymous before starting OMEMO
2019-04-17 13:58:45 +02:00
Paul Fariello
8c71a74afe Ensure MUC is Non-Anonymous before starting OMEMO
Store MUC anonymous type in mucwin for that purpose.

Fixes #1065
2019-04-17 13:56:27 +02:00
Paul Fariello
fc8dc328a4 Alert about long OMEMO cryptographic generation
Fixes #1055
2019-04-17 09:55:16 +02:00
Paul Fariello
f75e1d7a7b Support contact name in /omemo fingerprint command 2019-04-10 17:24:56 +02:00
Paul Fariello
277e8dc901 Add /omemo char command 2019-04-10 17:24:56 +02:00
Paul Fariello
0bc660400b Automatically starts OMEMO if one identity is trusted 2019-04-10 17:24:56 +02:00
Paul Fariello
e7be3a605b Add OMEMO in prefs command 2019-04-10 17:23:46 +02:00
Paul Fariello
898302243e Add clear_device_list command 2019-04-10 17:23:46 +02:00
Paul Fariello
4a1c3c8c1e Show all device fingerprint for current account 2019-04-10 17:12:31 +02:00
Paul Fariello
ba9679a706 Print fingerprint after trust and untrust command 2019-04-10 17:12:31 +02:00
Paul Fariello
3d8f47a724 Use /omemo fingerprint to show contact fingerprints
Don't print fingerprints when they are received
2019-04-10 17:12:31 +02:00
Paul Fariello
306706bd2e Add OMEMO log command 2019-04-10 17:12:31 +02:00
Paul Fariello
bc541cb8ac Add OMEMO end command 2019-04-10 17:12:31 +02:00
Paul Fariello
70109953ec Revert "Ensure room isn't anonymous"
This reverts commit 733e1a24c7e08dde6aa2c15ec4528220aa360845.
2019-04-10 17:12:31 +02:00
Paul Fariello
9044e3732c Ensure room isn't anonymous 2019-04-10 17:12:31 +02:00
Paul Fariello
031e906035 Cosmetics rename variable barejid into roomjid 2019-04-10 17:12:31 +02:00
Paul Fariello
cf528383bd Allow to start OMEMO in MUC 2019-04-10 17:12:31 +02:00