summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-08-30 02:27:44 -0400
committerEvan Prodromou <evan@prodromou.name>2008-08-30 02:27:44 -0400
commit755f192df05ff3468b483b20c7f35252c384165e (patch)
tree5533624de20b5a5d07dce6a64fde342fd32b1751
parentc3adc854da4928576741be99a9fe30c629065fe0 (diff)
correctly use attrs array rather than nonexistent attunction
darcs-hash:20080830062744-84dde-98c6419f4b66a570e9ef9de34d8d07e40aa1177d.gz
-rwxr-xr-xscripts/xmppdaemon.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php
index 6fc13ade4..574aeab36 100755
--- a/scripts/xmppdaemon.php
+++ b/scripts/xmppdaemon.php
@@ -136,25 +136,30 @@ class XMPPDaemon {
$this->log(LOG_WARNING, 'Forwarded message without addresses');
return NULL;
}
- $this->log(LOG_DEBUG, "Got addresses XML: " . $addresses->toString());
$address = $addresses->sub('address');
- $this->log(LOG_DEBUG, "Fetched address.");
if (!$address) {
$this->log(LOG_WARNING, 'Forwarded message without address');
return NULL;
}
- $type = $address->attr('type');
+ if (!array_key_exists('type', $address->attrs)) {
+ $this->log(LOG_WARNING, 'No type for forwarded message');
+ return NULL;
+ }
+ $type = $address->attrs['type'];
if ($type != 'ofrom') {
$this->log(LOG_WARNING, 'Type of forwarded message is not ofrom');
return NULL;
}
- $jid = $address->attr('jid');
+ if (!array_key_exists('jid', $address->attrs)) {
+ $this->log(LOG_WARNING, 'No jid for forwarded message');
+ return NULL;
+ }
+ $jid = $address->attrs['jid'];
if (!$jid) {
$this->log(LOG_WARNING, 'Could not get jid from address');
return NULL;
}
$this->log(LOG_DEBUG, 'Got message forwarded from jid ' . $jid);
-
return $jid;
}