about summary refs log tree commit diff stats
path: root/src/xmpp/message.c
Commit message (Collapse)AuthorAgeFilesLines
* Print all error stanzasMichael Vetter2020-10-301-5/+5
| | | | | | | | | | | | | | | | | | Regards https://github.com/profanity-im/profanity/issues/1435 So far we didn't print the error if it contained `<error type="cancel">`. It appears that the code always thought this is a service-not-available (so one is either blocked or the account doesn't exist) and printed `Recipient not found`. But there can be other errors as well. Like in above mentioned issue `not-allowed`. Let's just print the text. In case of the cancel type we still remove the jid from the chat sessions. I'm not entirely sure whether this needs to be done in other cases too.
* Enable _handle_ox_chat() payload/body decryptionMichael Vetter2020-10-091-3/+0
| | | | | This part of the code was waiting for xmpp_stanza_new_from_string() from libstrophe 0.10.0.
* Replace stanza_get_child_by_name_and_ns with ↵Michael Vetter2020-09-301-4/+4
| | | | | | | | xmpp_stanza_get_child_by_name_and_ns Replace our own stanza_get_child_by_name_and_ns() with the upstreamed xmpp_stanza_get_child_by_name_and_ns() provided by the new libstrophe/libmesode 0.10.0.
* Fix memory leak in _handle_chat()Dmitry Podgorny2020-08-071-21/+7
| | | | | jid_create() for attribute "to" was called twice and the 1st object was lost.
* Parse stanza-idMichael Vetter2020-07-231-5/+34
| | | | | | | | | | | | Add stable stanza IDs to ProfMessage struct. We parse this for 1:1 messages (MUC needs to be done too). <stanza-id> for live messages <result id="x"> for MAM messages Regards MAM: https://github.com/profanity-im/profanity/issues/660 Regards Stable IDs: https://github.com/profanity-im/profanity/issues/1207
* Apply coding styleMichael Vetter2020-07-071-272/+272
|
* Revert "Apply coding style"Michael Vetter2020-07-071-278/+278
| | | | | | This reverts commit 9b55f2dec0ea27a9ce4856e303425e12f866cea2. Sorting the includes creates some problems.
* Apply coding styleMichael Vetter2020-07-071-278/+278
| | | | Regards https://github.com/profanity-im/profanity/issues/1396
* message.c: Use message->to_jid instead of to_jidMichael Vetter2020-07-031-1/+1
| | | | This one will always be set.
* message.c: _handle_carbons() check from field outside of functionMichael Vetter2020-07-031-15/+17
| | | | | So that we don't have to pass the wrapping stanza and can handle the error nicer.
* message.c: Dont duplicate code in _handle_carbon and _handle_chatMichael Vetter2020-07-031-111/+66
| | | | | Trying to simplify the conditions so we don't have duplicate code in both of those functions.
* message.c: Remove from/to setting out of conditionMichael Vetter2020-07-031-6/+3
| | | | Since its done in both cases.
* message.c: Small code improvementsMichael Vetter2020-07-031-16/+16
|
* message.c: Put XEP-0085 code in helper functionMichael Vetter2020-07-031-18/+25
|
* Change formattingMichael Vetter2020-07-031-1/+2
|
* handle_headline(): Free text correctlyMichael Vetter2020-07-031-0/+2
|
* Handle headline stanzaStefan Kropp2020-07-031-1/+14
| | | | | | | | | | | | | | | Authored by DebXWoody in: https://github.com/profanity-im/profanity/pull/1369 Regards: https://github.com/profanity-im/profanity/issues/1366 Since I'm in the process of cleaning up message.c I take this now so he doesn't have to rebase. I also omitted the _handle_normal() case since I'm not sure that would be correct. Probably will be addressed again when continuing the cleanup.
* Fix messages with receipt request not displayedWilliam Wennerström2020-07-021-1/+0
| | | | | | | | Messages from Conversations contains: <request xmlns='urn:xmpp:receipts'/> And would not be displayed in Profanity as it never reached _handle_chat(..).
* message.c: Put plugin handler code in helper functionMichael Vetter2020-07-021-7/+14
|
* message.c: Log invalid message typeMichael Vetter2020-07-021-14/+14
| | | | | So far we logged when we receive a message without a type. Which is actually quite common and makes no sense.
* message.c: Check for message typeMichael Vetter2020-07-021-8/+4
| | | | | RFC 6121 allows only few types. So we can also remove that check in _handle_chat().
* message.c: Remove handled cases form _handle_chat()Michael Vetter2020-07-021-7/+0
| | | | Both cases are tested before entering that function.
* message.c: Break out of _message_handler() after handling codeMichael Vetter2020-07-021-0/+4
| | | | | AFAIK it can only be one. Except at STANZA_NS_MUC_USER which is used in several cases.
* message.c: Parse incoming message stanzas according to typeMichael Vetter2020-07-021-31/+34
|
* message.c: Add pubsub helper functionMichael Vetter2020-07-021-13/+19
|
* message.c: Add XEP informationMichael Vetter2020-07-021-1/+6
|
* message.c: Add my copyrightMichael Vetter2020-07-021-0/+1
|
* message.c: Make several functions staticMichael Vetter2020-07-021-3/+3
|
* message.c: Adjust function formattingMichael Vetter2020-07-021-8/+12
|
* And ifdefs around new OX functionsMichael Vetter2020-06-301-7/+10
| | | | | Fix for some build cases introduced in 2c94ee5a88f64332a3f41f41a4d314fc52200e31 Fix https://github.com/profanity-im/profanity/issues/1376
* Feature request - XEP-0373: OpenPGP for XMPP (OX)DebXWoody2020-06-291-0/+170
| | | | | | | | | Basic implementation of XEP-0373: OpenPGP for XMPP. https://xmpp.org/extensions/xep-0373.html Command /ox Issue: #1331
* Fix possible segfault in xmpp/message.cDmitry Podgorny2020-06-161-1/+1
| | | | Check for pointer to be NULL before dereferencing it.
* Fix carbon loggingMichael Vetter2020-05-271-4/+6
| | | | Regards https://github.com/profanity-im/profanity/issues/1342
* Add and use connection_get_barejid()Michael Vetter2020-05-251-4/+4
| | | | Instead of connection_get_fulljid() and then creating a Jid from it.
* Fix typing notificationMichael Vetter2020-05-211-1/+1
| | | | | | | | | | | | | | | | | | | With d1d0ad8d1a8e28690aa8723566dd64c1ccdcf9d6 we set a timestamp to now for all messages upon receival. Even if the original message didn't contain any timestamp. So we can use the timestamp of retrieval for logging and displaying and don't get them at each of those location where they might differ. This means that timestamp will never be NULL. I don't see why we would want to check for the chat state only if timestamp isn't there. Probably because in XEP-0085 there is not timestamp defined. So if it thats stanza it's not there and we can parse quicker, but there is nothing forbidden it to be there. Related to https://github.com/profanity-im/profanity/issues/1339
* _handle_carbons(): fix potential memleakMichael Vetter2020-04-211-2/+4
|
* MAM: Correctly display incoming MAM chat messageMichael Vetter2020-04-111-7/+12
|
* Add to_jid field to ProfMessage structMichael Vetter2020-04-111-24/+32
| | | | | Is usefult in many cases if we want cleaner code. Hope this edit didn't break anything though ;-)
* First test with receiving MAMMichael Vetter2020-04-111-0/+27
|
* _handle_chat: return if no 'from'Michael Vetter2020-04-111-0/+3
| | | | Let's not crash :-)
* Don't crash if we get a message without from or typeMichael Vetter2020-04-111-1/+8
| | | | | | | | MAM messages don't have a type nor a from. If we detect a message without type let's log it and exit without continuing to try to parse it. Otherwise we go into _handle_chat() and crash on the no from.
* Add type field to ProfMessageMichael Vetter2020-04-061-4/+8
| | | | The mucuser boolean is not now needed anymore.
* db: log all incoming and outgoing messagesMichael Vetter2020-04-061-3/+3
|
* Rename PROF_MSG_ENC_PLAIN to PROF_MSG_ENC_NONEMichael Vetter2020-04-061-1/+1
|
* Add timestamp for incoming messages if none is setMichael Vetter2020-04-061-0/+6
| | | | | | | | Timestamps are only set if a message is delayed. If none is set let's set it upon recaival so we don't have to set it when it gets displayed. This means we will also have it for logs etc in the ProfMessage.
* Use correct MUC message timestampMichael Vetter2020-03-091-0/+7
| | | | | | | | win_println_incoming_muc_msg() always used the current time. Now let's use whatever is sent int he message struct (from the delay stanza or the current time that we set now once the message is received). No playing with the time upon display anymore.
* Set muc history correctly in _handle_groupchat()Michael Vetter2020-02-251-1/+1
| | | | Fix init. mistake introduced in e9c5c1979d836ed75c37d48651710b4fd125cfb2
* Fix memleak in _handle_groupchat()Michael Vetter2020-02-251-1/+6
| | | | We need to unref the timestamp before setting a new one.
* Parse mentions and triggers in muc history if display is 'regular'Michael Vetter2020-02-201-1/+1
| | | | Fix https://github.com/profanity-im/profanity/issues/1261
* xep-0308: enable for carbon copied messagesMichael Vetter2020-02-141-0/+15
| | | | | | | If we are connected with another client and send a message, then correct it. We now display it correctly in Profanity. Id wasn't saved for carbon copied messages too so far.