strophe / libstrophe

A simple, lightweight C library for writing XMPP clients
http://strophe.im/libstrophe
Other
401 stars 163 forks source link

add xmpp_stanza_get_child_by_path() #187

Closed sjaeckel closed 2 years ago

sjaeckel commented 2 years ago

... to provide an easier way to find long paths.

After looking at some code in profanity-im/profanity#1605 I thought this could help to make libstrophe-user code easier to write (and read).

Initially it started off as xmpp_stanza_get_child_by_xpath() but then I was annoyed when it came to handling all those potential corner cases like e.g. escaping URL's in the ns ... so here we go with a vararg approach :)

Signed-off-by: Steffen Jaeckel jaeckel-floss@eyet-services.de

pasis commented 2 years ago

How about this name: xmpp_stanza_get_child_by_path()?

sjaeckel commented 2 years ago

right, if someone would ever be crazy enough to add full support for XPATHs they could still call the new API xmpp_stanza_get_child_by_xpath()

done