* @package XMPPHP
* @author Nathanael C. Fritz <JID: fritzy@netflint.net>
* @author Stephan Wentz <JID: stephan@jabber.wentz.it>
+ * @author Michael Garvin <JID: gar@netflint.net>
* @copyright 2008 Nathanael C. Fritz
*/
* @package XMPPHP
* @author Nathanael C. Fritz <JID: fritzy@netflint.net>
* @author Stephan Wentz <JID: stephan@jabber.wentz.it>
+ * @author Michael Garvin <JID: gar@netflint.net>
* @copyright 2008 Nathanael C. Fritz
* @version $Id$
*/
* @param string $name
* @return boolean
*/
- public function hasSub($name) {
+ public function hasSub($name, $ns = null) {
foreach($this->subs as $sub) {
- if($sub->name == $name) return true;
+ if(($name == "*" or $sub->name == $name) and ($ns == null or $sub->ns == $ns)) return true;
}
return false;
}
* @param string $ns
*/
public function sub($name, $attrs = null, $ns = null) {
+ #TODO attrs is ignored
foreach($this->subs as $sub) {
- if($sub->name == $name) {
+ if($sub->name == $name and ($ns == null or $sub->ns == $ns)) {
return $sub;
}
}