OLD | NEW |
1 // Copyright (c) 2011 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 |
24 struct Notification { | 34 struct Notification { |
25 // The channel the notification is coming in on. | 35 // The channel the notification is coming in on. |
26 std::string channel; | 36 std::string channel; |
| 37 // Recipients for this notification (may be empty). |
| 38 RecipientList recipients; |
27 // The notification data payload. | 39 // The notification data payload. |
28 std::string data; | 40 std::string data; |
29 | 41 |
30 std::string ToString() const; | 42 std::string ToString() const; |
31 }; | 43 }; |
32 | 44 |
33 } // namespace notifier | 45 } // namespace notifier |
34 | 46 |
35 #endif // JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_ | 47 #endif // JINGLE_NOTIFIER_LISTENER_NOTIFICATION_DEFINES_H_ |
OLD | NEW |