Add purple_tags_get_all_with_name

Review Request #2503 — Created July 7, 2023 and submitted

Information

pidgin/pidgin
default

Reviewers

I realized I needed this when I started porting XMPP to the new Contact API. I
need to be able to get a list of all the groups that a contact is in so I can
updated them appropriately but we didn't have the api for it. This is something
that other protocols will need to do as well so here's the API.

Ran the unit tests.

Summary ID
Add purple_tags_get_all_with_name
I realized I needed this when I started porting XMPP to the new Contact API. I need to be able to get a list of all the groups that a contact is in so I can updated them appropriately but we didn't have the api for it. This is something that other protocols will need to do as well so here's the API.
04b3c87484391889153f92b8711153171120f6b9
Description From Last Updated

We should also check whether the value pointer is inside the tag string and not outside after adding name_len to …

belginbelgin
belgin
  1. 
      
  2. libpurple/purpletags.c (Diff revision 1)
     
     
    Show all issues

    We should also check whether the value pointer is inside the tag string and not outside after adding name_len to it, since we're dereferencing it.

    1. A tag is a string comprised of a name and an options value. For example the tag display:1 has a name of display and a value of 1. Likewise, the tag display: has a name of display and an empty value (the *value == ':' case), and the tag display has a name of display and no value (the (*value == '\0') case).

    2. I see the case I mentioned is not possible because of the g_str_has_prefix function call above.

  3. 
      
ivanhoe
  1. Ship It!
  2. 
      
belgin
  1. Ship It!
  2. 
      
grim
Review request changed
Status:
Completed