summaryrefslogtreecommitdiff
path: root/modules/presence
diff options
context:
space:
mode:
authorJuha Heinanen <jh@tutpro.com>2016-03-13 10:04:05 +0200
committerJuha Heinanen <jh@tutpro.com>2016-03-13 10:04:05 +0200
commitc72b65860f42c3cae92a76a8dc35ac6e6e61ad8c (patch)
treeb9e44fe91cc2d8f319cb7862ae84a3a1f31d3c08 /modules/presence
parent1b10113475504cec501b2f6d2e18204e635d871f (diff)
modules/presence: allow white space before xml element closing tags
Diffstat (limited to 'modules/presence')
-rw-r--r--modules/presence/subscriber.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/presence/subscriber.c b/modules/presence/subscriber.c
index 0aaa8c9..f8a21e3 100644
--- a/modules/presence/subscriber.c
+++ b/modules/presence/subscriber.c
@@ -81,7 +81,7 @@ static void notify_handler(struct sip *sip, const struct sip_msg *msg,
enum presence_status status = PRESENCE_CLOSED;
struct presence *pres = arg;
const struct sip_hdr *type_hdr, *length_hdr;
- struct pl pl;
+ struct pl pl, ws1 = PL_INIT, ws2 = PL_INIT;
if (pres->shutdown)
goto done;
@@ -116,25 +116,25 @@ static void notify_handler(struct sip *sip, const struct sip_msg *msg,
}
if (!re_regex((const char *)mbuf_buf(msg->mb), mbuf_get_left(msg->mb),
- "<basic>[^<]+</basic>", &pl)) {
+ "<basic[ \t]*>[^<]+</basic[ \t]*>", &ws1, &pl, &ws2)) {
if (!pl_strcasecmp(&pl, "open"))
status = PRESENCE_OPEN;
}
if (!re_regex((const char *)mbuf_buf(msg->mb), mbuf_get_left(msg->mb),
- "<rpid:away/>")) {
+ "<rpid:away[ \t]*/>")) {
status = PRESENCE_CLOSED;
}
else if (!re_regex((const char *)mbuf_buf(msg->mb),
mbuf_get_left(msg->mb),
- "<rpid:busy/>")) {
+ "<rpid:busy[ \t]*/>")) {
status = PRESENCE_BUSY;
}
else if (!re_regex((const char *)mbuf_buf(msg->mb),
mbuf_get_left(msg->mb),
- "<rpid:on-the-phone/>")) {
+ "<rpid:on-the-phone[ \t]*/>")) {
status = PRESENCE_BUSY;
}