1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-29 19:56:07 -04:00
Commit Graph

547 Commits

Author SHA1 Message Date
Michael Vetter
a668ca45b7 Allow utf8 in roster contact char 2021-10-22 16:23:18 +02: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
Michael Vetter
f21595597f Format code correctly 2021-10-05 10:01:27 +02:00
Michael Vetter
ba7b6c2e96 Clean sourcepath from profrc
See 3b3a6b7a75 for sourcepath removal.
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
0a8d69dc46 Enable whole word only notifications by default
Set PREF_NOTIFY_MENTION_WHOLE_WORD to true.

If I'm not mistaken the _mucwin_print_mention() / get_mentions()
functions only work correctly since
6bc440c6f7.

This changed the behaviour for users.
They got notified when their nick was `kaffee` and in the message the
string `kaffeekanne` occured.

Setting `/notify room mention word_whole` corrected this.

So my idea is that only now the mention function work correctly. And to
have a good default behaviour we should set the `word_whole` on by
default.

Regards https://github.com/profanity-im/profanity/issues/1578
2021-09-08 12:04:34 +02:00
Michael Vetter
9bd635d7e6 accounts: get rid of guard around free 2021-07-17 23:13:01 +02:00
Dmitry Podgorny
e7b6051e57 Fix memory leak in accounts_get_login_status() 2021-07-17 18:11:32 +03: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
Thorben Günther
0fc3343d75
Restore last status string when connecting 2021-07-01 16:08:00 +02:00
Michael Vetter
7db8f6f5a4 Disable notifications by default
Since I didn't find a way to discover whether a notification server is
running I decided to disable them by default. So people without one will
not have such a bad lag due to timeout from libnotify.

Fix https://github.com/profanity-im/profanity/issues/977
2021-06-28 19:22:22 +02:00
Michael Vetter
242381cfd0 editor: Use datadir instead of tmp dir
See
https://github.com/profanity-im/profanity/issues/1521#issue-860017824
2021-06-10 16:51:28 +02:00
Jörg Thalheim
a5a0dd6c91
external editor: don't use absolute paths and allow path search 2021-05-30 23:14:05 +02:00
Michael Vetter
64244474d3 Have intype on by default 2021-05-08 19:41:38 +02:00
Michael Vetter
1d8061e89b Have separate settings for intype
Old: `/intype on|of`
Typing information is printed in console and titlebar.

New: `/intype titlebar|console on|off`
Typing information can be configured in more detail.

Regards https://github.com/profanity-im/profanity/issues/1516
2021-05-08 19:38:40 +02:00
Stefan
3ba38eafa8
OMEMO - trust mode (#1506)
Add OMEMO trust mode capabilities.

* ToFu / first usage
* blind trust
* manual
2021-04-17 13:28:54 +02:00
Stefan
9f32b2afb2 Editor: Using preferences compose.editor
compose.editor is the path to the executable ( default /usr/bin/vim )
2021-04-16 18:04:03 +02: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
Thorben Günther
f1780f0017
MUC: Show offline members in sidebar 2021-03-08 14:34:59 +01:00
Michael Vetter
8c08e64f37 Update copyright 2021-01-08 16:36:30 +01:00
William Wennerström
01e8f01ed3
Add /executable (urlsave|urlopen) migrations 2020-12-18 16:05:11 +01:00
William Wennerström
695a1d3c8c
Use popen for eval_password (reintroduce old behavior)
Old commit that implemented the old behavior:
bc9e6b79cd
2020-12-15 15:45:16 +01:00
William Wennerström
32cfea4bd2
Refactor call_external 2020-12-11 15:51:01 +01:00
Michael Vetter
a8990014e2 Use whole path as logfile when defined via -f
`profanity -f my` created ~/.local/share/profanity/logs/my.log`.

It would be nicer if one could define the actual path, so one can choose
another directory or even use /dev/null.

Fixes https://github.com/profanity-im/profanity/issues/1442
2020-12-11 10:40:10 +01:00
Michael Vetter
3b093553e1 Set default color for trackbar
Fix https://github.com/profanity-im/profanity/issues/1453
2020-12-10 15:07:55 +01:00
Michael Vetter
a94378f206 Fix various typos 2020-12-10 09:24:32 +01:00
Tim Gates
93480bed09
docs: fix simple typo, certian -> certain
There is a small typo in src/config/theme.c.

Should read `certain` rather than `certian`.
2020-12-10 05:25:37 +11:00
Michael Vetter
5179b253c4 Purge omemo sendfile from config
https://github.com/profanity-im/profanity/pull/1375 added omemo media sharing support.

Thus the protection
(https://github.com/profanity-im/profanity/pull/1270) to sending files plainly in an omemo chat isn't
needed anymore and got removed.

Lets clean it from the config file.
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
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
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
9d58472c8c
Remove /omemo sendfile 2020-11-16 21:58:08 +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
304f63f204 Dont initialize i twice in accounts_get_account() 2020-11-05 09:38:57 +01:00
Philipp Klaus Krause
6a276e74e3 Since the string from strerror should never be modified, use const. 2020-10-14 09:52:26 +02:00
nia
52e9be4abc Basic support for building on NetBSD.
- Add NetBSD as a recognized platform without -ldl.
- Allow building with NetBSD libcurses instead of ncurses.
- Portability to NetBSD sh - use POSIX '=' instead of '=='.
2020-09-04 12:55:20 +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
William Wennerström
deb0818a1b
Log errors from eval_password
All errors were discarded to /dev/null if the error_ptr was set to
NULL.
2020-07-06 11:02:04 +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
322caf877e Transform url.open.cmd to new default scheme
Additionally to:
7de83217c4
1e2a288d80
2020-07-02 11:14:27 +02:00
Michael Vetter
6ada720e18 executable: actually take the user set default if a certain scheme is
not found
2020-07-02 10:59:45 +02:00
Michael Vetter
59f5b81b85 cmd_url_*(): use gchar instead of char 2020-07-02 10:58:31 +02:00
Michael Vetter
1e2a288d80 Use correct format when transforming old urlopen.cmd
Additionally to ec7e635e75.

In the earlier commit I just setted the test value ignoring the real
format.

Now we correctly transform:

```
[logging]
urlopen.cmd=xdg-open
```

into:

```
[executables]
url.open.cmd=false;xdg-open %u;
```
2020-07-02 10:22:18 +02:00
Pierre Mazière
274e695320 use '*' to set a default executable
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-07-02 09:52:43 +02:00
Michael Vetter
92cba92c5d Add default value for titlebar.scrolled
Fix https://github.com/profanity-im/profanity/issues/1380
2020-07-01 18:37:35 +02:00
Michael Vetter
ec7e635e75 Move url/avatar commands from logging to exectuables section
c56d530b67 by peetah moves:
urlopen.cmd from the 'logging' to a new 'executables' section in profrc
avatar.cmd from the 'logging' to a new 'executables' section in profrc

We need to adapt this so that users don't have to set the setting again
themselves.
2020-07-01 15:29:57 +02:00
Michael Vetter
b580b9ef11 prefs_free_string() doesnt need to check if pref is NULL
g_free(NULL); is noop.
2020-07-01 14:42:35 +02:00
Michael Vetter
9b514ad3d6 files.c: use const char *const where appropriate 2020-07-01 10:07:42 +02:00
Michael Vetter
1224aa414e Use files_get_account_data_path instead of duplicate code
We often had a use case where we want the account specific data dir.
Let's create a function for this instead of doing it by hand each time.
2020-07-01 10:05:45 +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
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
7e652f4ca0 Add string and string list preferences with option
Where GKeyFile usually use the pref[locale] format to define
locale specific translated data, it is here hijacked to be used
as pref[option] in order to specialize a preference according
to an option:

open.url.cmd[pdf] = pdf-viewer
open.url.cmd[jpg] = image-viewer

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-25 15:03:04 +02:00
Michael Vetter
b79d7e8752 Fix NULL terminated list
Regards https://github.com/profanity-im/profanity/issues/1367
2020-06-23 14:42:09 +02:00
Michael Vetter
448f7f0936 Use shell to start eval_password command
Since d92c576aa5
we rely on g_spawn_sync().
Which doesn't do variable/glob expansion.

For our use of call_external() in opening and URL or avatar this is
fine.

For getting the password we want to be able to use ~ for our files.
Let's use a shell here.

Fix https://github.com/profanity-im/profanity/issues/1364
2020-06-19 20:17:20 +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
74e061165a Define POSIX macro to have strdup
98c38dc6d6
sets C99 as standard.

strdup() is not part of C99.

For now set `-D_POSIX_C_SOURCE=200809L` macro to have strdup() in C99.
Using `gnu99` instead would be another option.

We should take more care to use glib functions whenever possible.

Regards https://github.com/profanity-im/profanity/issues/1357
2020-06-12 16:12:21 +02:00
Michael Vetter
f1141932fc Dont manipulate pointer from getenv
Found this when looking to fix bug https://github.com/profanity-im/profanity/issues/1357
Not sure if it is related.

man 3 getenv sais:
```
As  typically implemented, getenv() returns a pointer to a string within
the environment list.  The caller must take  care  not  to  modify  this
string, since that would change the environment of the process.
```
2020-06-12 10:23:31 +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
Pierre Mazière
fad77d9d70 Use external_call to get password via eval_password command
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
2020-06-03 13:09:29 +02:00
Michael Vetter
d03c953d4a PoC for bookmark ignore
```
~/.local/share/profanity % cat bookmark_ignore
[ignore]
profanity@rooms.dismail.de=
```

Regards https://github.com/profanity-im/profanity/issues/1115
2020-05-24 12:55:43 +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
fcd69532ad Make 'scrolled' themeable 2020-05-21 09:16:18 +02:00
Michael Vetter
21cc53bdfd Make urlopen command configurable 2020-05-20 10:54:58 +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
51518497e5 Add hidden MAM setting and trigger MAM retrievel when opening new window
Only when we start the conversation.
Not yet when we get messaged and a new window is opened.
Need to have sorting of messages in the window buffer then, I guess.
Also MAM IQ should only be send one time in such a case.

If MAM is enabled history from sql backend will not be shown.

`mam` in profrc enables experimental MAM.
Can change soon again. Don't rely on stuff in this stage ;)
2020-04-12 00:42:02 +02:00
Michael Vetter
11663625cc db: Have one database per account 2020-04-06 10:50:20 +02:00
Michael Vetter
a7163b24f3 database: Define chatlog database location 2020-04-06 10:50:20 +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
4f19ea2642 Add -t theme option
`profanity -t bios` loads the bios theme now.

Fix https://github.com/profanity-im/profanity/issues/1286
2020-03-24 23:00:39 +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
ed97e3730a Enable popular features by default
Most clients have them enabled by default already for a smoother modern XMPP experience.

Enable by default: allowing message corrections, sending of read
receipts, enabling carbons, typing/chat states.
2020-03-17 09:13:57 +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
Dmitry Podgorny
d18ec23d0a Fix few memory leaks 2020-02-27 01:35:36 +02:00
Michael Vetter
75cfe38808 Allow setting custom log file via -f FILENAME
`profanity -f TEST` will use `~/.local/share/profanity/logs/TEST.log` as
the log file.
2020-02-21 21:10:00 +01:00
Michael Vetter
6dbbbe11e5 Make trackbar color configurable
Use `main.trackbar` in themes.
2020-02-21 19:12:16 +01:00
Michael Vetter
669de0ca52 Improve setting encryption char error handling 2020-02-21 14:51:19 +01:00
Michael Vetter
fd04727212 pref: Use helper functions for setting/getting the encryption char
Dont duplicate code.
2020-02-21 09:51:40 +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
280b718cfb Fix theme setting correction char
Copy paste error. We actually set the omemo char..
2020-02-20 16:50:17 +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
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
Michael Vetter
3c1db1cd32 xep-0308: make correction.char themeable 2020-02-10 14:58:22 +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
7df964fe7b Set PREF_COLOR_NICK to false by default 2020-02-06 10:54:03 +01:00
Paul Fariello
be7157065c Add default pref for PREF_COLOR_NICK
Fix a segfault if corresponding preference is not saved in config file.
2020-02-05 15:29:17 +01:00
Paul Fariello
a52e3ea1d8 Add context to autocomplete_with_func and use it for omemo trust command
Fix #1068
2020-01-31 10:07:08 +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
5c41c5b380 Add comments to preferences.c 2020-01-29 11:50:04 +01:00
Michael Vetter
7dbc0baef3 Refactor theme.c
Make _theme_list_dir() static.
Sort _load_preferences() loadings accoding to type.
Add comments.
2020-01-29 11:49:08 +01:00
Michael Vetter
8c34f2ce01 xep-0092: add config option to set whether OS is revealed
Default is on. `revail.os=false` in the `connection` section of the
config can disable it.
A command to configure this will follow.
2020-01-23 23:35:46 +01:00
Michael Vetter
2d19ad0db4 Add option to notify about version request
Cannot be configured for now.
Can be set via `adv.notify.discoversion` in the `notification` section.

Will notify about version requests via XEP-0092 and XEP-0232.

Client version can still be seen via caps (capabilities).
See `stanza_attach_caps()`.
2020-01-23 22:54:47 +01:00