| OLD | NEW |
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """A bare-bones and non-compliant XMPP server. | 5 """A bare-bones and non-compliant XMPP server. |
| 6 | 6 |
| 7 Just enough of the protocol is implemented to get it to work with | 7 Just enough of the protocol is implemented to get it to work with |
| 8 Chrome's sync notification system. | 8 Chrome's sync notification system. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import asynchat | 11 import asynchat |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 self._connections.discard(xmpp_connection) | 585 self._connections.discard(xmpp_connection) |
| 586 self._handshake_done_connections.discard(xmpp_connection) | 586 self._handshake_done_connections.discard(xmpp_connection) |
| 587 | 587 |
| 588 def ForwardNotification(self, unused_xmpp_connection, notification_stanza): | 588 def ForwardNotification(self, unused_xmpp_connection, notification_stanza): |
| 589 if self._notifications_enabled: | 589 if self._notifications_enabled: |
| 590 for connection in self._handshake_done_connections: | 590 for connection in self._handshake_done_connections: |
| 591 print 'Sending notification to %s' % connection | 591 print 'Sending notification to %s' % connection |
| 592 connection.ForwardNotification(notification_stanza) | 592 connection.ForwardNotification(notification_stanza) |
| 593 else: | 593 else: |
| 594 print 'Notifications disabled; dropping notification' | 594 print 'Notifications disabled; dropping notification' |
| OLD | NEW |