From 5ab475cf35171503cbbdf443ab45b10374331d4a Mon Sep 17 00:00:00 2001 From: manuroe Date: Mon, 7 May 2018 10:46:33 +0200 Subject: [PATCH] Send Stickers: Pass widget id to widgets urls #1860 This is mandatory for the sticker picker widget --- Riot/Utils/Widgets/Widget.m | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Riot/Utils/Widgets/Widget.m b/Riot/Utils/Widgets/Widget.m index cbdd106089..0ac7714afe 100644 --- a/Riot/Utils/Widgets/Widget.m +++ b/Riot/Utils/Widgets/Widget.m @@ -70,9 +70,6 @@ - (MXHTTPOperation *)widgetUrl:(void (^)(NSString * _Nonnull))success failure:(v widgetUrl = [widgetUrl stringByReplacingOccurrencesOfString:@"$matrix_display_name" withString:displayName]; widgetUrl = [widgetUrl stringByReplacingOccurrencesOfString:@"$matrix_avatar_url" withString:avatarUrl]; - // And add the user scalar token - widgetUrl = [widgetUrl stringByAppendingString:[NSString stringWithFormat:@"&scalar_token=%@", scalarToken]]; - // Integrate widget data into widget url for (NSString *key in _data) { @@ -100,6 +97,14 @@ - (MXHTTPOperation *)widgetUrl:(void (^)(NSString * _Nonnull))success failure:(v } } + // Add the user scalar token + widgetUrl = [widgetUrl stringByAppendingString:[NSString stringWithFormat:@"%@scalar_token=%@", + [widgetUrl containsString:@"?"] ? @"&" : @"?", + scalarToken]]; + + // Add the widget id + widgetUrl = [widgetUrl stringByAppendingString:[NSString stringWithFormat:@"&widgetId=%@", _widgetId]]; + success(widgetUrl); }