Merge branch 'develop' into develop-widgets
This commit is contained in:
@@ -120,4 +120,5 @@ enum RichObjectStringObjectType {
|
||||
@JsonValue('guest') guest,
|
||||
@JsonValue('highlight') highlight,
|
||||
@JsonValue('talk-poll') talkPoll,
|
||||
@JsonValue('geo-location') geoLocation,
|
||||
}
|
||||
|
||||
@@ -113,4 +113,5 @@ const _$RichObjectStringObjectTypeEnumMap = {
|
||||
RichObjectStringObjectType.guest: 'guest',
|
||||
RichObjectStringObjectType.highlight: 'highlight',
|
||||
RichObjectStringObjectType.talkPoll: 'talk-poll',
|
||||
RichObjectStringObjectType.geoLocation: 'geo-location',
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ abstract class WebuntisApi extends ApiRequest {
|
||||
WebuntisApi(this.method, this.genericParam, {this.authenticatedResponse = true});
|
||||
|
||||
|
||||
Future<String> query(WebuntisApi untis) async {
|
||||
Future<String> query(WebuntisApi untis, {bool retry = false}) async {
|
||||
var query = '{"id":"ID","method":"$method","params":${untis._body()},"jsonrpc":"2.0"}';
|
||||
|
||||
var sessionId = '0';
|
||||
@@ -32,8 +32,9 @@ abstract class WebuntisApi extends ApiRequest {
|
||||
dynamic jsonData = jsonDecode(data.body);
|
||||
if(jsonData['error'] != null) {
|
||||
if(jsonData['error']['code'] == -8520) {
|
||||
if(retry) throw WebuntisError('Authentication was tried (probably session timeout), but was not successful!', 1);
|
||||
await Authenticate.createSession();
|
||||
this.query(untis);
|
||||
return await this.query(untis, retry: true);
|
||||
} else {
|
||||
throw WebuntisError(jsonData['error']['message'], jsonData['error']['code']);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ Future<void> main() async {
|
||||
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem').then(addCertificateAsTrusted),
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r10.pem').then(addCertificateAsTrusted),
|
||||
PlatformAssetBundle().load('assets/ca/lets-encrypt-r13.pem').then(addCertificateAsTrusted),
|
||||
|
||||
Future(() async {
|
||||
await HydratedStorage.build(
|
||||
|
||||
@@ -41,7 +41,7 @@ class EndpointData {
|
||||
|
||||
Endpoint webuntis() => EndpointOptions(
|
||||
live: Endpoint(
|
||||
domain: 'peleus.webuntis.com',
|
||||
domain: 'marianum-fulda.webuntis.com',
|
||||
),
|
||||
staged: Endpoint(
|
||||
domain: 'mhsl.eu',
|
||||
|
||||
@@ -13,8 +13,11 @@ class ParticipantsListView extends StatelessWidget {
|
||||
lastname(participant) => participant.displayName.toString().split(' ').last;
|
||||
|
||||
final participants = participantsResponse.data
|
||||
.sorted((a, b) => lastname(a).compareTo(lastname(b)))
|
||||
.sorted((a, b) => a.participantType.index.compareTo(b.participantType.index));
|
||||
.sorted((a, b) {
|
||||
final typeComparison = a.participantType.index.compareTo(b.participantType.index);
|
||||
if (typeComparison != 0) return typeComparison;
|
||||
return lastname(a).compareTo(lastname(b));
|
||||
});
|
||||
var groupedParticipants = participants.groupListsBy((participant) => participant.participantType);
|
||||
|
||||
return Scaffold(
|
||||
@@ -27,7 +30,7 @@ class ParticipantsListView extends StatelessWidget {
|
||||
children: [
|
||||
ListTile(
|
||||
title: Text(entry.key.prettyName),
|
||||
titleTextStyle: TextStyle(fontWeight: FontWeight.bold),
|
||||
titleTextStyle: Theme.of(context).textTheme.titleMedium
|
||||
),
|
||||
...entry.value.map((participant) => ListTile(
|
||||
leading: UserAvatar(id: participant.actorId),
|
||||
|
||||
Reference in New Issue
Block a user