1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-10-27 20:30:13 -04:00
Commit Graph

5547 Commits

Author SHA1 Message Date
Michael Vetter
d3dd95963e Sort includes in python_api.c 2019-10-07 15:53:17 +02:00
Michael Vetter
b3ed213668 Improve MUC 1:1 logging
If we get a private message from a user in a MUC profanity shows this
like:
`profanity@roomsASDF.dismail.de/Martin: Hi`

This was so far logged at:
`~/.local/share/profanity/chatlogs/my-account-at-server/profanity_at_rooms.dismail.de/2019_09_04.log` as:

```
10:48:13 - profanity@rooms.dismail.de: Hi
```

So the nickname was not saved anywhere. This is due to us not knowing
whether we got a regular message from user@server.org/resource or a MUC
PM from room@server.org/user.

We now check for `<x xmlns='http://jabber.org/protocol/muc#user' />` and
add the resourcepart to the logging if we get it.

The file will be created at
`~/.local/share/profanity/chatlogs/my-account-at-server/profanity_at_rooms.dismail.de_nick` and look like:

```
23:59:43 - nick: Hi
```

Fix https://github.com/profanity-im/profanity/issues/1184
2019-10-07 00:05:37 +02:00
Michael Vetter
f1d31e024c Fix typo handel -> handle 2019-10-06 23:00:08 +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
147be3afdf Don't log own messages on incoming MUC
`sv_ev_room_message()` called `groupchat_log_msg_in()` to log all
incoming MUC messages.

`cl_ev_send_muc_msg()` calls `groupchat_log_msg_out()`.

So messages sent by the user himself was logged two times.

Filter the incoming messages and only log the ones not from our occupant
jid/nick.

Fix https://github.com/profanity-im/profanity/issues/1201
2019-10-06 22:32:58 +02:00
Michael Vetter
7d7997e93c Add account clear example to help
Give example on how to clear pgpkeyig.
2019-10-06 20:46:50 +02:00
Michael Vetter
a10ab4e692 First destroy roster then free list in test_cmd_roster 2019-10-06 19:13:45 +02:00
Michael Vetter
9b3517c21e Free strings in autocomplete_param_no_with_func
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 19:05:27 +02:00
Michael Vetter
94b401ab96 Fix invalid read in muc code
We didn't set the variables to NULL, but the rest of the code depends on
this check.
```
==22201== Invalid read of size 8
==22201==    at 0x44E560: autocomplete_clear (autocomplete.c:69)
==22201==    by 0x427B2C: muc_invites_clear (muc.c:190)
==22201==    by 0x461328: ev_disconnect_cleanup (common.c:59)
==22201==    by 0x463FB5: cl_ev_disconnect (client_events.c:91)
==22201==    by 0x431252: cmd_disconnect (cmd_funcs.c:1234)
==22201==    by 0x47E883: clears_chat_sessions
(test_cmd_disconnect.c:28)
==22201==    by 0x487E9E1: _run_test (in /usr/lib64/libcmocka.so.0.7.0)
==22201==    by 0x487ECCC: _run_tests (in /usr/lib64/libcmocka.so.0.7.0)
==22201==    by 0x47F1BE: main (unittests.c:629)
==22201==  Address 0x814b690 is 0 bytes inside a block of size 24 free'd
==22201==    at 0x48379AB: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22201==    by 0x44E5F7: autocomplete_free (autocomplete.c:90)
==22201==    by 0x4278A0: muc_close (muc.c:97)
==22201==    by 0x47DBAA: cmd_join_uses_password_when_supplied
(test_cmd_join.c:169)
==22201==    by 0x487E9E1: _run_test (in /usr/lib64/libcmocka.so.0.7.0)
==22201==    by 0x487ECCC: _run_tests (in /usr/lib64/libcmocka.so.0.7.0)
==22201==    by 0x47F1BE: main (unittests.c:629)
==22201==  Block was alloc'd at
==22201==    at 0x483677F: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22201==    by 0x44E51B: autocomplete_new (autocomplete.c:57)
==22201==    by 0x427837: muc_init (muc.c:88)
==22201==    by 0x47DA77: cmd_join_uses_password_when_supplied
(test_cmd_join.c:154)
==22201==    by 0x487E9E1: _run_test (in /usr/lib64/libcmocka.so.0.7.0)
==22201==    by 0x487ECCC: _run_tests (in /usr/lib64/libcmocka.so.0.7.0)
==22201==    by 0x47F1BE: main (unittests.c:629)
```
2019-10-06 19:00:46 +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
98676613fd Free strings in test_cmd_alias
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:45:53 +02:00
Michael Vetter
5b19ed28ce Free lits in test_cmd_roster unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:43:27 +02:00
Michael Vetter
1d23d6461d Remove not needed strdupin test_cmd_rooms
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:40:51 +02:00
Michael Vetter
5349b60385 Free autocomplete_complete results in unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:34:28 +02:00
Michael Vetter
2526e396f8 Fix autocomplete memleak in test_autocomplete
autocomplete_free() calls autocomplete_clear() and then frees the struct
itself.

Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:26:34 +02:00
Michael Vetter
b591f0cf2b Free list in error case in parse_options
Fix memleaks.

Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:12:50 +02:00
Michael Vetter
700f97d78c Free lists in test_roster_list
Fix memleaks.
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:06:30 +02:00
Michael Vetter
9e6bc99d08 Fix two memleaks in test_parser
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:59:46 +02:00
Michael Vetter
1fabb61b40 Fix memleak in cmd_bookmark_list_shows_bookmarks unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:54:40 +02:00
Michael Vetter
6776e39644 Fix memleak in test_parser unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:50:29 +02:00
Michael Vetter
d2a087145c Fix memleak in test_callbacks unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:47:13 +02:00
Michael Vetter
4f11140bb5 Fix memleak in test_parser unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:43:10 +02:00
Michael Vetter
897dfbb3c1 Fix memleak in get_start()
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:42:44 +02:00
Michael Vetter
57ebb7cfa6 Destroy hash table ein autocompleters_destroy()
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:29:35 +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
81b537b36d Fix test_callbacks memleak
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:15:06 +02:00
Michael Vetter
ae9ef75bab Fix test_jid unittest memleak
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:07:00 +02:00
Michael Vetter
fd18230cd4 Fix unittest memleak in test_cmd_join
muc_init() call without muc_close()

Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-05 23:38:10 +02:00
Michael Vetter
4e8f0c90b5 Fix preferences memory leak
Memory leak detected through unit tests.

Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-05 20:45:07 +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
d7c00360ea
Merge pull request #874 from spiridoncha/master
Change /clear behaviour. Closes issue #855.
2019-10-05 15:12:44 +02:00
Michael Vetter
4637a7a23b Merge remote-tracking branch 'philipflohr/master' 2019-10-05 15:04:46 +02:00
Michael Vetter
c135f989ec Check errors in is_dir() is_regular_file()
In case of error print the error. And return right value.

Improvement based on @pasis advice in https://github.com/profanity-im/profanity/pull/1036
Applying in preparation to merge that PR.
2019-10-04 23:29:10 +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
523681a642 Log outgoing carbons instead of incoming
Incoming carbons are logged as normal message already.
So we had this logged twice but didn't log outgoing carbons,
send from our account but by another client, at all.

Fix https://github.com/profanity-im/profanity/issues/1181
2019-10-04 13:22:14 +02:00
Michael Vetter
bf8fe3e7e6
Merge pull request #1200 from mzagozen/master
Include $PYTHON_EXTRA_LIBS in libtool config
2019-10-01 20:27:08 +02:00
Marko Zagožen
d3530b755d Include PYTHON_EXTRA_LIBS in libtool config
Fixes compilation when using custom Python installed with pyenv.
2019-10-01 18:13:12 +02:00
Michael Vetter
584131eddb Update version in spec file 2019-09-30 19:17:07 +02:00
Michael Vetter
7da2a444da Mention XEP-0191 in blocked command 2019-09-30 19:12:47 +02:00
Michael Vetter
53c4c8548b Document how to block users in MUCs
Regards https://github.com/profanity-im/profanity/issues/618
2019-09-30 19:11:30 +02:00
Michael Vetter
e8420e7235 Bind key to switch to next active window
alt-a brings one to the next window with unread messages.

Regards https://github.com/profanity-im/profanity/issues/1114
2019-09-30 18:28:05 +02:00
Michael Vetter
d6c638c70f Define keybindings to switch to up to 20 windows
alt-2 brings one ot the window.
irssi supports alt + 1234567890qwertyuio to easily switch to 20 windows
instead of just ten.

Hardcode this too.

Regards https://github.com/profanity-im/profanity/issues/1114
2019-09-30 17:42:32 +02:00
Michael Vetter
6ab6fe8649 Detect MUC history correctly with some Prosody versions
Some versions of prosody send the domainpart.
See https://issues.prosody.im/1416

Workaround to handle those cases.
Thanks to Holger Weiss for helping with this!

Fix https://github.com/profanity-im/profanity/issues/1190
2019-09-30 10:01:19 +02:00
Michael Vetter
6161235733 Remove not needed code
Was left over from refactoring a long time ago.
2019-09-29 15:47:24 +02:00
Michael Vetter
d1f388cbd7 Add comment about statusbar.current 2019-09-29 15:47:11 +02:00
Michael Vetter
d9fb5a896a Add statusbar.current to template 2019-09-29 15:31:24 +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