Chromium Code Reviews| Index: jingle/notifier/listener/push_notifications_send_update_task.cc |
| diff --git a/jingle/notifier/listener/push_notifications_send_update_task.cc b/jingle/notifier/listener/push_notifications_send_update_task.cc |
| index 50ec15e3cf45ab58336d26730ba77e533cc07b25..ae559a6cd16f11a0d9f547fc879644e8bbb57e36 100644 |
| --- a/jingle/notifier/listener/push_notifications_send_update_task.cc |
| +++ b/jingle/notifier/listener/push_notifications_send_update_task.cc |
| @@ -26,9 +26,14 @@ PushNotificationsSendUpdateTask::PushNotificationsSendUpdateTask( |
| PushNotificationsSendUpdateTask::~PushNotificationsSendUpdateTask() {} |
| int PushNotificationsSendUpdateTask::ProcessStart() { |
| - scoped_ptr<buzz::XmlElement> stanza( |
| - MakeUpdateMessage(notification_, |
| - GetClient()->jid().BareJid())); |
| + scoped_ptr<buzz::XmlElement> stanza; |
| + if (notification_.ping) { |
| + stanza.reset(MakePingStanza(notification_, task_id())); |
| + } else { |
| + stanza.reset(MakeUpdateMessage(notification_, |
| + GetClient()->jid().BareJid())); |
| + } |
| + |
| DVLOG(1) << "Sending notification " << notification_.ToString() |
| << " as stanza " << XmlElementToString(*stanza); |
| if (SendStanza(stanza.get()) != buzz::XMPP_RETURN_OK) { |
| @@ -91,4 +96,13 @@ buzz::XmlElement* PushNotificationsSendUpdateTask::MakeUpdateMessage( |
| return message; |
| } |
| +buzz::XmlElement* PushNotificationsSendUpdateTask::MakePingStanza( |
| + const Notification& notification, std::string task_id) { |
| + DCHECK(notification.ping); |
| + buzz::XmlElement* stanza = |
| + MakeIq(buzz::STR_GET, buzz::Jid(buzz::STR_EMPTY), task_id); |
|
Vitaly Buka (NO REVIEWS)
2012/10/22 20:52:53
buzz::XmlElement* stanza = MakeIq(buzz::STR_GET,
gene
2012/10/22 21:44:12
Done.
|
| + stanza->AddElement(new buzz::XmlElement(buzz::QN_PING)); |
| + return stanza; |
| +} |
| + |
| } // namespace notifier |