mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-14 01:55:16 +00:00
[ADD/MOD] XMPP->Matrix media bridge, small cleanup
This commit is contained in:
parent
4de7227ee7
commit
42d69226f0
14 changed files with 327 additions and 54 deletions
|
|
@ -131,3 +131,26 @@ XMLookForUnique(XMLElement *parent, char *tag)
|
|||
|
||||
return NULL;
|
||||
}
|
||||
XMLElement *
|
||||
XMLookForTKV(XMLElement *parent, char *tag, char *k, char *v)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if (!parent || !tag || !k || !v)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < ArraySize(parent->children); i++)
|
||||
{
|
||||
XMLElement *child = ArrayGet(parent->children, i);
|
||||
HashMap *attrs = child->attrs;
|
||||
char *value = HashMapGet(attrs, k);
|
||||
if (StrEquals(child->name, tag) && StrEquals(value, v))
|
||||
{
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue