JitsiWidgetData: Add authentication type field.

This commit is contained in:
SBiOSoftWhare
2020-10-27 15:30:15 +01:00
parent 8116a2ab56
commit bcd20d1cdb
2 changed files with 19 additions and 5 deletions
@@ -34,6 +34,9 @@ NS_ASSUME_NONNULL_BEGIN
// YES if the Jitsi conference is intended to be an audio-only call
@property (nonatomic) BOOL isAudioOnly;
// Indicate the authentication supported by the Jitsi server if any otherwise nil if there is no authentication supported.
@property (nonatomic, nullable) NSString *authenticationType;
@end
NS_ASSUME_NONNULL_END
@@ -29,6 +29,9 @@
BOOL isAudioOnly = NO;
MXJSONModelSetBoolean(isAudioOnly, JSONDictionary[@"isAudioOnly"])
NSString *authenticationType;
MXJSONModelSetString(authenticationType, JSONDictionary[@"auth"]);
// Sanitiy check
if (!conferenceId)
{
@@ -39,17 +42,25 @@
model.domain = domain;
model.conferenceId = conferenceId;
model.isAudioOnly = isAudioOnly;
model.authenticationType = authenticationType;
return model;
}
- (NSDictionary *)JSONDictionary
{
return @{
@"domain": _domain,
@"conferenceId": _conferenceId,
@"isAudioOnly": @(_isAudioOnly),
};
NSMutableDictionary *jsonDictionary = [@{
@"domain": _domain,
@"conferenceId": _conferenceId,
@"isAudioOnly": @(_isAudioOnly),
} mutableCopy];
if (_authenticationType)
{
jsonDictionary[@"auth"] = _authenticationType;
}
return jsonDictionary;
}