diff options
| author | Anton <anton@picapica.im> | 2026-11-11 07:11:46 +0400 |
|---|---|---|
| committer | Anton <anton@picapica.im> | 2026-11-11 07:11:46 +0400 |
| commit | 5d70834359245f0350496abfa08ca86de3847780 (patch) | |
| tree | 1864e272f4ee46cd81bda5f94c21aeccba4f32cd | |
| parent | c5e1422d90fa6e7eecec677e7c149dda3cdadc70 (diff) | |
| download | pica-pica-5d70834359245f0350496abfa08ca86de3847780.tar.gz pica-pica-5d70834359245f0350496abfa08ca86de3847780.zip | |
pica-client: MSGOK state check
| -rw-r--r-- | PICA_client.c | 7 |
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; } |
