| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_ | 5 #ifndef JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_ | 
| 6 #define JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_ | 6 #define JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| 11 namespace notifier { | 11 namespace notifier { | 
| 12 | 12 | 
| 13 struct Subscription { | 13 struct Subscription { | 
| 14   // The name of the channel to subscribe to; usually but not always | 14   // The name of the channel to subscribe to; usually but not always | 
| 15   // a URL. | 15   // a URL. | 
| 16   std::string channel; | 16   std::string channel; | 
| 17   // A sender, which could be a domain or a bare JID, from which we | 17   // A sender, which could be a domain or a bare JID, from which we | 
| 18   // will accept pushes. | 18   // will accept pushes. | 
| 19   std::string from; | 19   std::string from; | 
| 20 }; | 20 }; | 
| 21 | 21 | 
| 22 typedef std::vector<Subscription> SubscriptionList; | 22 typedef std::vector<Subscription> SubscriptionList; | 
| 23 | 23 | 
| 24 // A structure representing a <recipient/> block within a push message. |  | 
| 25 struct Recipient { |  | 
| 26   // The bare jid of the recipient. |  | 
| 27   std::string to; |  | 
| 28   // User-specific data for the recipient. |  | 
| 29   std::string user_specific_data; |  | 
| 30 }; |  | 
| 31 |  | 
| 32 typedef std::vector<Recipient> RecipientList; |  | 
| 33 |  | 
| 34 struct Notification { | 24 struct Notification { | 
| 35   Notification(); |  | 
| 36   ~Notification(); |  | 
| 37 |  | 
| 38   // The channel the notification is coming in on. | 25   // The channel the notification is coming in on. | 
| 39   std::string channel; | 26   std::string channel; | 
| 40   // Recipients for this notification (may be empty). |  | 
| 41   RecipientList recipients; |  | 
| 42   // The notification data payload. | 27   // The notification data payload. | 
| 43   std::string data; | 28   std::string data; | 
| 44 | 29 | 
| 45   std::string ToString() const; | 30   std::string ToString() const; | 
| 46 }; | 31 }; | 
| 47 | 32 | 
| 48 }  // namespace notifier | 33 }  // namespace notifier | 
| 49 | 34 | 
| 50 #endif  // JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_ | 35 #endif  // JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_ | 
| OLD | NEW | 
|---|