summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-11-11 07:11:46 +0400
committerAnton <anton@picapica.im>2026-11-11 07:11:46 +0400
commit5d70834359245f0350496abfa08ca86de3847780 (patch)
tree1864e272f4ee46cd81bda5f94c21aeccba4f32cd
parentc5e1422d90fa6e7eecec677e7c149dda3cdadc70 (diff)
downloadpica-pica-5d70834359245f0350496abfa08ca86de3847780.tar.gz
pica-pica-5d70834359245f0350496abfa08ca86de3847780.zip
pica-client: MSGOK state check
-rw-r--r--PICA_client.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/PICA_client.c b/PICA_client.c
index d763cdc..d26287f 100644
--- a/PICA_client.c
+++ b/PICA_client.c
@@ -1023,6 +1023,13 @@ static unsigned int procmsg_MSGOK(unsigned char* buf, unsigned int nb, void* p)
{
struct PICA_c2c *chan = (struct PICA_c2c *)p;
+ /* A delivery receipt is only meaningful once the channel is active, same
+ * as procmsg_MSGUTF8 - the c2c stream is also parsed in the pre-active
+ * WAITINGREP/WAITINGC2CPROTOVER states.
+ */
+ if (chan->state != PICA_C2C_STATE_ACTIVE)
+ return 0;
+
callbacks.msgok_cb(chan -> peer_id);
return 1;
}