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

5084 Commits

Author SHA1 Message Date
MarcoPolo-PasTonMolo
a2f79a19b9 Fix duplicate sent messages in db 2022-07-10 11:17:35 +03:00
MarcoPolo-PasTonMolo
85aaf40432 Have ability to scroll through history even without MAM 2022-07-10 11:17:35 +03:00
MarcoPolo-PasTonMolo
47b3e528e2 Handle scrolling down when buffer fills up 2022-07-10 11:17:35 +03:00
MarcoPolo-PasTonMolo
b03c3bda98 Cleanup 2022-07-05 11:30:04 +03:00
MarcoPolo-PasTonMolo
4d6e95d691 Add loading history message on initial MAM request
This prevents scrolling to top and initiating another MAM request while
still fetching the initial one.
Also free timestamp object in database.c
2022-07-05 11:12:29 +03:00
MarcoPolo-PasTonMolo
6429698f18 Fix initial MAM not displaying
Did this by waiting for a batch of MAM messages to arrive before
prepending them to the buffer. Also limited the number of messages
to fetch to 10 so that the user gets more frequent updates.
2022-07-05 00:06:04 +03:00
MarcoPolo-PasTonMolo
e9da694265 Add 'Loading messages' message when scrolling up 2022-07-04 12:39:59 +03:00
MarcoPolo-PasTonMolo
97a610e915 Fech data from mam when all history gets displayed
Fetch from mam without displaying when all mam messages get received
display new messages from db.
Unstable, initial mam doesn't get displayed unless we start scrolling.
2022-07-03 21:30:02 +03:00
MarcoPolo-PasTonMolo
ea83165a35 Get messages from history when scrolling up. 2022-07-03 21:29:36 +03:00
MarcoPolo-PasTonMolo
f0202a2fe0 On new chatwin fetch mam according to guidelines.
Taken from here:
cd3e871e55
2022-07-03 21:23:07 +03:00
MarcoPolo-PasTonMolo
13f1b831df Improve cmd argument parser
"" used to become " now it just becomes an empty argument.
Also if quotes appeared after a token started then if the number of
quotes in the token is n the resulting one would be a token with the
n last characters cut off, now it's fixed.

Fixes https://github.com/profanity-im/profanity/issues/497
2022-06-16 21:07:15 +03:00
Michael Vetter
35d10868f4 Reset buffer correctly 2022-06-15 15:09:38 +02:00
swirl
7276db07f4
remove memset in cons_show_qrcode
Signed-off-by: swirl <swurl@swurl.xyz>
2022-06-15 08:36:24 -04:00
swirl
7ed944254f
remove VLAs in OMEMO QR Code function
Removes the use of VLAs in favor of calloc

Signed-off-by: swirl <swurl@swurl.xyz>
2022-06-14 21:04:26 -04:00
Michael Vetter
4d6bc1adf8
Merge pull request #1717 from MarcoPolo-PasTonMolo/fix/chat-with-self-duplicate-msgs
Fix duplicate messages in chat with oneself.
2022-06-11 12:33:56 +02:00
Michael Vetter
8c313011c0 Fix typo in omemo command 2022-06-05 17:25:53 +02:00
Michael Vetter
2e85f18cd6 Use our omemo sid/fingerprint in qr code
Current clients sid/fingerprint will be shown in following format:
`xmpp:<user@server>?omemo-sid-<numerical-sid>=<omemo-fingerprint-hex-string>`

Fix https://github.com/profanity-im/profanity/issues/1320
2022-05-31 15:44:44 +02:00
MarcoPolo-PasTonMolo
91e8a89b59 Fix duplicate messages in chat with oneself.
Messages would get duplicated when you chat with yourself, worse if you
had omemo enabled the duplicated message would say something along the
lines of "Your client doesn't support OMEMO". The cause was carbons
when the message was sent from another client, whilst it was a sent
and received message when profanity was the one to send it. This commit
ignores the carbon message in the 1st case and ignores the received one
in the 2nd.

Fixes https://github.com/profanity-im/profanity/issues/1595
2022-05-31 15:55:02 +03:00
Michael Vetter
42fb8f86d9 Add command help for omemo qrcode 2022-05-30 18:04:42 +02:00
swirl
d64cb38240 Reverse QR code colors and add padding
All QR scanners should be able to recognize this, as it is now the
correct color with some padding to prevent blending.

Signed-off-by: swirl <swurl@swurl.xyz>
2022-05-30 18:04:42 +02:00
swirl
9a9a97868d implement working OMEMO QR code
TODO: We need to find a way to switch the colors of the QR code, so that
more QR readers can detect it, without "blending" the edges of the QR
code with the surrounding terminal window.

Signed-off-by: swirl <swurl@swurl.xyz>
2022-05-30 18:04:42 +02:00
Michael Vetter
cf83976b51 Add basic qrcode functions 2022-05-30 18:04:36 +02:00
Michael Vetter
010ed78b32
Merge pull request #1714 from MarcoPolo-PasTonMolo/feature/avatar-set
Add `/avatar set` command to publish avatar
2022-05-30 18:01:50 +02:00
Michael Vetter
d9e39b596b
Merge pull request #1712 from MarcoPolo-PasTonMolo/fix/1347
Update capabilities of muc on available presence
2022-05-29 16:21:45 +02:00
MarcoPolo-PasTonMolo
4839093a8b Make muc config update after form submit
Muc configuration in profanity used to not update until next login, ie:
make muc non_anonymous and members_only but be unable to start omemo
until next login. Now a disco info request is sent after forrm submit
and chatroom details are changed accordingly.

Fixes https://github.com/profanity-im/profanity/issues/1347
2022-05-27 18:51:35 +03:00
Michael Vetter
d510f3a430 Final touches for /avatar set 2022-05-27 10:46:36 +02:00
Michael Vetter
09f3c08af5 Fix description of mood 2022-05-27 09:36:41 +02:00
MarcoPolo-PasTonMolo
63f694d6a7 Respect silent nick change in mucs
Profanity would ignore the silent nick change in some places. The roster
and history would show the correct nick, new messages from the current
user and the "Autojoined <jid> as <nick>" message would show the wrong
one. This commit fixes that problem.

Fixes https://github.com/profanity-im/profanity/issues/757
2022-05-26 21:57:42 +03:00
MarcoPolo-PasTonMolo
0cff111249 Add checks for whether gdk-pixbuf exists before using avatar set 2022-05-26 21:06:27 +03:00
MarcoPolo-PasTonMolo
719f3fbee0 Fix segfault on /ox discover
`/ox discover` segfaults on some misconfigured? nodes because there are
newlines before and after some pubkey-metadata stanzas so the newlines
get treated as seperate stanzas. This commit just skips each stanza in
public-keys-list that doesn't have a fingerprint.

Fixes https://github.com/profanity-im/profanity/issues/1713
2022-05-26 19:00:56 +03:00
MarcoPolo-PasTonMolo
6a44e18853 Add /avatar set command to publish avatar
Use `/avatar set <path>` where <path> is an image file to upload a new
avatar for the current user. When the avatar is too big it gets scaled
down. Scaling code copied from dino.

Fixes https://github.com/profanity-im/profanity/issues/1687
2022-05-26 17:49:34 +03:00
MarcoPolo-PasTonMolo
4ea1ed8324 Fix room name not updating.
Now whenever the name of a room changes, either in profanity or another
client, it gets updated inside profanity.
Fixes https://github.com/profanity-im/profanity/issues/1710
2022-05-18 16:47:33 +03:00
Michael Vetter
1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
Michael Vetter
e17ea040c9 Log encrypted messages by default to chatlog
In case chatlogs are available lets log everything by default.
Seems like most users expect this behaviour and I agree.
2022-05-09 14:16:28 +02:00
Michael Vetter
2e76e4f0c7 ox: remove /ox sendfile because its actually not implemented 2022-05-05 23:55:37 +02:00
Michael Vetter
b16bdca726 ox: show ox preferences 2022-05-05 23:55:31 +02:00
Michael Vetter
d011d6707c ox: Add /ox log command 2022-05-05 23:41:45 +02:00
Michael Vetter
66eeccf408 ox: only process proper messages
We only want to have the decrypted message or the alternative body in
message->plain.

Also let's print error messages if it makes sense and log other issues.

Partly addresses the commit in the comit mesage of:
2dc0cc489c
2022-05-04 16:11:00 +02:00
Michael Vetter
1eaa2c1529 ox: prefix function _openpgp_signcrypt with ox_
To make the destinction clearer and easier to search.
2022-05-04 14:26:43 +02:00
Michael Vetter
54b57326b8 ox: have metadata node open
Should have been done alogn with e9f218cdf6.

Like this people who are not in the roster can get our public key and
write messages to use.
2022-05-04 13:46:02 +02:00
Michael Vetter
0500e209a6 ox: return upon invalid fingerprint 2022-05-04 13:37:12 +02:00
Michael Vetter
e5e661e92d ox: fix mistakes in p_ox_gpg_decrypt()
strcpy() can't work here because the data doesn't have to be
NULL-terminated. So let's use memcpy.

Fix memleak of plain_str.
2022-05-04 11:35:15 +02:00
Michael Vetter
281c8b7d8d Improve ox command help
Mention new man page.
Correct the usage of /ox request.
2022-05-04 00:22:18 +02:00
Michael Vetter
acedd42d78 ox: print message when /ox end is run but not started 2022-05-04 00:03:45 +02:00
Michael Vetter
58911926de ox: print more error messages to UI 2022-05-03 23:39:10 +02:00
Michael Vetter
c3deb5d325 ox: dont require marginal trust level
Maybe we can make this configurable later.
So users have the freedom to be more strict.

This commit partly reverts 62018f48c5.

Example to edit trust level:
```
gpg --edit-key somekeyid
gpg (GnuPG) 2.3.4; Copyright (C) 2021 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

pub  rsa4096/keyid
     created: 2020-06-26  expires: 2022-06-26  usage: SC
     trust: unknown       validity: full
sub  rsa4096/keyid
     created: 2020-06-26  expires: 2022-06-26  usage: E
[  full  ] (1). xmpp:user@domain.de

gpg> trust
pub  rsa4096/keyid
     created: 2020-06-26  expires: 2022-06-26  usage: SC
     trust: unknown       validity: full
sub  rsa4096/keyid
     created: 2020-06-26  expires: 2022-06-26  usage: E
[  full  ] (1). xmpp:user@domain.de

Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)

  1 = I don't know or won't say
  2 = I do NOT trust
  3 = I trust marginally
  4 = I trust fully
  5 = I trust ultimately
  m = back to the main menu

Your decision? 3

pub  rsa4096/keyid
     created: 2020-06-26  expires: 2022-06-26  usage: SC
     trust: marginal      validity: full
sub  rsa4096/keyid
     created: 2020-06-26  expires: 2022-06-26  usage: E
[  full  ] (1). xmpp:user@domain.de
Please note that the shown key validity is not necessarily correct
unless you restart the program.

gpg> quit
```
2022-05-03 23:11:25 +02:00
Stefan Kropp
c9e6a89aea Bugfix OX rpad generation
________________________________________
< No comment - should be much better now >
 ----------------------------------------
 \
  \
   \ >()_
      (__)__ _
2022-05-03 23:00:11 +02:00
Stefan Kropp
62018f48c5 ox_key_is_usable - Logging and owner trust check
* Added logging messages (INFO if key can not be used)
 * Check owner_trust < GPGME_VALIDITY_MARGINAL

The key can not be used if the owner_trust is less than MARGINAL.
2022-05-03 23:00:11 +02:00
Michael Vetter
7acc044a52 ox: use glib date function in _gettimestamp and fix memleak 2022-05-03 21:26:31 +02:00
Michael Vetter
e16bff2328 ox: Use connection_create_stanza_id() instead of xmpp_uuid_gen() 2022-05-03 19:54:43 +02:00