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

34 Commits

Author SHA1 Message Date
Michael Vetter
f147a5ca27 Change default download location
`/url save $someurl` will now download to
`~/.local/share/profanity/downloads/from_jid/date/filename` instead of
`~/.local/share/profanity/downloads`.

Like this the downloaded files should be better ordered.

This will only happen for MUC and 1:1 chat windows.
Private windows might have only a nick or jid. Lets not distinguish
between those two ways. And since the nick option is unreliable to be
the same person lets just put them in the general downloads folder.
As is done with downloads from all other windows as well.

I also had the idea to make this configurable but this suits my needs
and time limits right now.
2024-06-20 13:35:14 +02:00
Michael Vetter
569e37f018 Update copyright to 2024 2024-01-22 16:03:48 +01:00
Steffen Jaeckel
ca2df180d8 Introduce a shared implementation for keyfile loading
Instead of copy&pasting the same code over again, use a common
implementation.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-09-04 09:59:09 +02:00
Michael Vetter
e853c121d9 Fix my email address
in all files
2023-07-31 16:51:58 +02:00
John Hernandez
09f217d667 Improve documentation 2023-07-13 21:22:42 +02:00
John Hernandez
8304ac86ff g_free() to auto_gfree, introduce auto_guchar
Fix 11 potential mem leaks in theme.c
2023-07-13 17:04:59 +02:00
John Hernandez
3a4cd7da48 Cleanup and mem leak fix
Improve usage of `gchar` and `char` by setting them correctly
Increase usage of `auto_gchar` and `auto_char`
Fix 2 mem leaks (rosterwin.c, avatar.c)
2023-07-12 17:43:33 +02:00
John Hernandez
00bea804e2 Improve documentation two functions
Namely `cmd_process_input()` and `files_get_data_path()`.

Edited by @jubalh.
2023-07-11 13:26:37 +02:00
John Hernandez
e1d137f4e6 Change char->free to auto_char char for autocleanup
Replace `gchar` and `g_free` to `auto_gchar`
Correct certain  `char` functions/variables to `gchar`

Related to #1819.

Edited by @jubalh.
2023-07-11 13:26:37 +02:00
John Hernandez
7f3fca2bd0 Cleanup: gchar as gchar instead of char
Use gchar instead of char in most of the cases where gchar is intended.

Reason: improve compatibility and stability. Issue #1819

Minor refactoring.
2023-05-04 16:15:09 +02:00
Michael Vetter
3adc399da0 Update copyright year 2023-01-10 10:37:25 +01:00
Michael Vetter
1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
Steffen Jaeckel
4d71848837 replace GString usage where a simple strdup works
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-14 13:17:46 +01:00
Steffen Jaeckel
705b6f7806 use g_mkdir_with_parents() instead of home-baked solution
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-14 13:17:46 +01:00
Steffen Jaeckel
b8e46552bf add files_file_in_account_data_path()
As all parts of the code invoking the `files_get_account_data_path()`
function did the same afterwards, a function has been added with the same
behavior.

1. create path
2. `mkdir` of that path
3. return final path

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2022-03-13 14:15:02 +01:00
Michael Vetter
f21595597f Format code correctly 2021-10-05 10:01:27 +02: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
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
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
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
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
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
46fd7150e5 Add vim modeline 2019-11-13 12:11:05 +01:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
James Booth
250e972b7a Update copyright 2018-01-21 15:00:02 +00:00
James Booth
68a3daedb9 Update Copyright 2017-01-28 17:24:22 +00:00
James Booth
a3a73cf003 Move all filepath handling to files.c 2016-07-24 21:49:35 +01:00
James Booth
29452f8f1b Move xgd functions 2016-07-24 17:12:09 +01:00
James Booth
ef942bd27a Add config/files.c 2016-07-24 16:22:15 +01:00