From 9b0654c7f204cebe6eac2431211a732b41936bfe Mon Sep 17 00:00:00 2001 From: Ivan Brazza Date: Thu, 28 Jan 2016 17:10:55 +0000 Subject: [PATCH] New: Setting Pushbullet source device --- .../Notifications/PushBullet/PushBulletProxy.cs | 6 ++++++ .../Notifications/PushBullet/PushBulletSettings.cs | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs index 98f3b2d3d..d9dfca8fb 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs @@ -5,6 +5,7 @@ using NLog; using RestSharp; using NzbDrone.Core.Rest; +using NzbDrone.Common.Extensions; namespace NzbDrone.Core.Notifications.PushBullet { @@ -151,6 +152,11 @@ private void SendNotification(string title, string message, RestRequest request, request.AddParameter("title", title); request.AddParameter("body", message); + if (settings.SenderId.IsNotNullOrWhiteSpace()) + { + request.AddParameter("source_device_iden", settings.SenderId); + } + client.Authenticator = new HttpBasicAuthenticator(settings.ApiKey, string.Empty); client.ExecuteAndValidate(request); } diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs index 9872a922a..d2c6d1e4c 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletSettings.cs @@ -33,6 +33,9 @@ public PushBulletSettings() [FieldDefinition(2, Label = "Channel Tags", HelpText = "List of Channel Tags to send notifications to", Type = FieldType.Tag)] public IEnumerable ChannelTags { get; set; } + [FieldDefinition(3, Label = "Sender ID", HelpText = "The device ID to send notifications from, use device_iden in the device's URL on pushbullet.com (leave blank to send from yourself)")] + public string SenderId { get; set; } + public NzbDroneValidationResult Validate() { return new NzbDroneValidationResult(Validator.Validate(this));