Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/hbuf.c @ 2032:f740c4128f76
Fix receipts handling according to recent XEP updates
* add lm_get_uid() @xmpp_helper.h
* identify receipts by id attribute of 'received' subelement
instead of stanza id
author | Myhailo Danylenko <isbear@ukrpost.net> |
---|---|
date | Sun, 14 Oct 2012 17:39:11 +0200 |
parents | 10eead2ba1b7 |
children | f5402d705f67 |
comparison
equal
deleted
inserted
replaced
2031:2b13be73351d | 2032:f740c4128f76 |
---|---|
523 } | 523 } |
524 | 524 |
525 // hbuf_remove_receipt(hbuf, xep184) | 525 // hbuf_remove_receipt(hbuf, xep184) |
526 // Remove the Receipt Flag for the message with the given xep184 id | 526 // Remove the Receipt Flag for the message with the given xep184 id |
527 // Returns TRUE if it was found and removed, otherwise FALSE | 527 // Returns TRUE if it was found and removed, otherwise FALSE |
528 gboolean hbuf_remove_receipt(GList *hbuf, gpointer xep184) | 528 gboolean hbuf_remove_receipt(GList *hbuf, gconstpointer xep184) |
529 { | 529 { |
530 hbuf_block *blk; | 530 hbuf_block *blk; |
531 | 531 |
532 hbuf = g_list_last(hbuf); | 532 hbuf = g_list_last(hbuf); |
533 | 533 |
534 for ( ; hbuf; hbuf = g_list_previous(hbuf)) { | 534 for ( ; hbuf; hbuf = g_list_previous(hbuf)) { |
535 blk = (hbuf_block*)(hbuf->data); | 535 blk = (hbuf_block*)(hbuf->data); |
536 if (blk->prefix.xep184 == xep184) { | 536 if (!g_strcmp0(blk->prefix.xep184, xep184)) { |
537 g_free(blk->prefix.xep184); | |
537 blk->prefix.xep184 = NULL; | 538 blk->prefix.xep184 = NULL; |
538 blk->prefix.flags ^= HBB_PREFIX_RECEIPT; | 539 blk->prefix.flags ^= HBB_PREFIX_RECEIPT; |
539 return TRUE; | 540 return TRUE; |
540 } | 541 } |
541 } | 542 } |