Skip to content

Commit

Permalink
Send Stickers: Pass widget id to widgets urls
Browse files Browse the repository at this point in the history
#1860
This is mandatory for the sticker picker widget
  • Loading branch information
manuroe committed May 7, 2018
1 parent 7a0afe1 commit 5ab475c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Riot/Utils/Widgets/Widget.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 5ab475c

Please sign in to comment.