First cut of support for pubsub push notifications by Rob Ostensen.

This commit is contained in:
Rob Ostensen authored and Andrew McMillan committed 2009-11-02 14:25:09 +13:00
1 parent 1ad6713dfc
commit 9164c3a8bd
2 files changed
+43

No files matched your search

+20
View File
@@ -180,6 +180,12 @@ class CalDAVPrincipal
$this->dropbox_url = sprintf( '%s.drop/', $this->url);
$this->notifications_url = sprintf( '%s.notify/', $this->url);
if ( isset ( $c->notifications_server ) ) {
$this->xmpp_uri = 'xmpp:pubsub.'.$c->notifications_server['host'].'?pubsub;node=/home/'.$c->notifications_server['host'];
$this->xmpp_uri .= '/'.preg_replace ( '/@.*$/', '', $c->notifications_server['jid'] ).'/DAViCal'.$this->url;
$this->xmpp_server = $c->notifications_server['host'];
}
$this->group_member_set = array();
$qry = new PgQuery('SELECT * FROM relationship LEFT JOIN usr ON (from_user = usr.user_no) LEFT JOIN role_member ON (to_user = role_member.user_no) LEFT JOIN roles USING (role_no) WHERE to_user = ? AND role_name = '."'Group'", $this->user_no );
if ( $qry->Exec('CalDAVPrincipal') && $qry->rows > 0 ) {
@@ -406,6 +412,20 @@ class CalDAVPrincipal
$reply->CalendarserverElement($prop, 'notifications-URL', $reply->href($this->notifications_url) );
break;
case 'http://calendarserver.org/ns/:xmpp-server':
if ( isset ( $this->xmpp_uri ) )
$reply->CalendarserverElement($prop, 'xmpp-server', $this->xmpp_server );
else
$not_found[] = $reply->Tag($tag);
break;
case 'http://calendarserver.org/ns/:xmpp-uri':
if ( isset ( $this->xmpp_uri ) )
$reply->CalendarserverElement($prop, 'xmpp-uri', $this->xmpp_uri );
else
$not_found[] = $reply->Tag($tag);
break;
case 'urn:ietf:params:xml:ns:caldav:calendar-home-set':
$reply->CalDAVElement($prop, 'calendar-home-set', $reply->href( $this->calendar_home_set ) );
break;