Line data Source code
1 : /* 2 : * Famedly Matrix SDK 3 : * Copyright (C) 2021 Famedly GmbH 4 : * 5 : * This program is free software: you can redistribute it and/or modify 6 : * it under the terms of the GNU Affero General Public License as 7 : * published by the Free Software Foundation, either version 3 of the 8 : * License, or (at your option) any later version. 9 : * 10 : * This program is distributed in the hope that it will be useful, 11 : * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 : * GNU Affero General Public License for more details. 14 : * 15 : * You should have received a copy of the GNU Affero General Public License 16 : * along with this program. If not, see <https://www.gnu.org/licenses/>. 17 : */ 18 : 19 : class StoredInboundGroupSession { 20 : final String roomId; 21 : final String sessionId; 22 : final String pickle; 23 : final String content; 24 : final String indexes; 25 : final String allowedAtIndex; 26 : final bool uploaded; 27 : final String senderKey; 28 : final String senderClaimedKeys; 29 : 30 24 : StoredInboundGroupSession({ 31 : required this.roomId, 32 : required this.sessionId, 33 : required this.pickle, 34 : required this.content, 35 : required this.indexes, 36 : required this.allowedAtIndex, 37 : required this.uploaded, 38 : required this.senderKey, 39 : required this.senderClaimedKeys, 40 : }); 41 : 42 9 : factory StoredInboundGroupSession.fromJson(Map<String, dynamic> json) => 43 9 : StoredInboundGroupSession( 44 9 : roomId: json['room_id'], 45 9 : sessionId: json['session_id'], 46 9 : pickle: json['pickle'], 47 9 : content: json['content'], 48 9 : indexes: json['indexes'], 49 9 : allowedAtIndex: json['allowed_at_index'], 50 9 : uploaded: json['uploaded'], 51 9 : senderKey: json['sender_key'], 52 9 : senderClaimedKeys: json['sender_claimed_keys'], 53 : ); 54 : 55 48 : Map<String, dynamic> toJson() => { 56 24 : 'room_id': roomId, 57 24 : 'session_id': sessionId, 58 24 : 'pickle': pickle, 59 24 : 'content': content, 60 24 : 'indexes': indexes, 61 24 : 'allowed_at_index': allowedAtIndex, 62 24 : 'uploaded': uploaded, 63 24 : 'sender_key': senderKey, 64 24 : 'sender_claimed_keys': senderClaimedKeys, 65 : }; 66 : }