diff --git a/lib/famedlysdk.dart b/lib/famedlysdk.dart index e47eb0b..145ffd5 100644 --- a/lib/famedlysdk.dart +++ b/lib/famedlysdk.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + library famedlysdk; export 'package:famedlysdk/src/responses/ErrorResponse.dart'; diff --git a/lib/src/Client.dart b/lib/src/Client.dart index ea991d8..ab97c04 100644 --- a/lib/src/Client.dart +++ b/lib/src/Client.dart @@ -1,7 +1,28 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'dart:async'; -import 'dart:convert'; import 'dart:core'; -import 'package:flutter/material.dart'; import 'responses/ErrorResponse.dart'; import 'Connection.dart'; import 'Store.dart'; diff --git a/lib/src/Connection.dart b/lib/src/Connection.dart index 74fd489..009228f 100644 --- a/lib/src/Connection.dart +++ b/lib/src/Connection.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'dart:async'; import 'dart:convert'; import 'dart:core'; diff --git a/lib/src/Event.dart b/lib/src/Event.dart index 70cf258..0e277a2 100644 --- a/lib/src/Event.dart +++ b/lib/src/Event.dart @@ -1,7 +1,30 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'dart:convert'; -import './User.dart'; import 'package:famedlysdk/src/utils/ChatTime.dart'; import 'package:famedlysdk/src/Client.dart'; +import './User.dart'; class Event { final String id; diff --git a/lib/src/Room.dart b/lib/src/Room.dart index 43b33a2..831e76c 100644 --- a/lib/src/Room.dart +++ b/lib/src/Room.dart @@ -1,10 +1,32 @@ -import 'dart:convert'; +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'package:famedlysdk/src/Client.dart'; import 'package:famedlysdk/src/utils/ChatTime.dart'; import 'package:famedlysdk/src/utils/MxContent.dart'; import 'package:famedlysdk/src/responses/ErrorResponse.dart'; -import './User.dart'; import 'package:famedlysdk/src/Event.dart'; +import './User.dart'; /// FIXME use actual Matrix Stuff. This is a placeholder class Room { diff --git a/lib/src/Store.dart b/lib/src/Store.dart index 4c4bbd6..bee8c74 100644 --- a/lib/src/Store.dart +++ b/lib/src/Store.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'dart:async'; import 'dart:convert'; import 'dart:core'; diff --git a/lib/src/User.dart b/lib/src/User.dart index 120abd9..410100d 100644 --- a/lib/src/User.dart +++ b/lib/src/User.dart @@ -1,13 +1,47 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'package:famedlysdk/src/Client.dart'; import 'package:famedlysdk/src/utils/MxContent.dart'; import 'package:famedlysdk/src/Room.dart'; +/// Represents a Matrix User which may be a participant in a Matrix Room. class User { + + /// The membership status of the user final String status; + + /// The full qualified Matrix ID in the format @username:server.abc final String mxid; + + /// The displayname of the user if the user has set one. final String displayName; + + /// The avatar if the user has one. final MxContent avatar_url; + final String directChatRoomId; + final Room room; const User( @@ -19,10 +53,13 @@ class User { this.room, }); + /// Returns the displayname or the local part of the Matrix ID if the user + /// has no displayname. String calcDisplayname() => displayName.isEmpty ? mxid.replaceFirst("@", "").split(":")[0] : displayName; + /// Creates a new User object from a json string like a row from the database. static User fromJson(Map json) { return User(json['matrix_id'], displayName: json['displayname'], diff --git a/lib/src/responses/ErrorResponse.dart b/lib/src/responses/ErrorResponse.dart index ecd571c..19f3f59 100644 --- a/lib/src/responses/ErrorResponse.dart +++ b/lib/src/responses/ErrorResponse.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + /// Represents a special response from the Homeserver for errors. class ErrorResponse { diff --git a/lib/src/sync/EventUpdate.dart b/lib/src/sync/EventUpdate.dart index 4bb4d7e..66307fa 100644 --- a/lib/src/sync/EventUpdate.dart +++ b/lib/src/sync/EventUpdate.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + /// Represents a new event (e.g. a message in a room) or an update for an /// already known event. class EventUpdate { diff --git a/lib/src/sync/RoomUpdate.dart b/lib/src/sync/RoomUpdate.dart index 5fc27c5..58573eb 100644 --- a/lib/src/sync/RoomUpdate.dart +++ b/lib/src/sync/RoomUpdate.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + /// Represents a new room or an update for an /// already known room. class RoomUpdate { diff --git a/lib/src/utils/ChatTime.dart b/lib/src/utils/ChatTime.dart index 0c5a9bc..49d0094 100644 --- a/lib/src/utils/ChatTime.dart +++ b/lib/src/utils/ChatTime.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'package:intl/intl.dart'; class ChatTime { diff --git a/lib/src/utils/MxContent.dart b/lib/src/utils/MxContent.dart index e179a9e..6d52123 100644 --- a/lib/src/utils/MxContent.dart +++ b/lib/src/utils/MxContent.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'package:famedlysdk/src/Client.dart'; import 'dart:core'; diff --git a/pubspec.yaml b/pubspec.yaml index a4992dc..d2ae232 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: famedlysdk description: Matrix SDK for the famedly talk app written in dart. version: 0.0.1 -author: famedly +author: Zender & Kurtz GbR homepage: https://famedly.com environment: diff --git a/test/Client_test.dart b/test/Client_test.dart index 5e5e93d..6af424f 100644 --- a/test/Client_test.dart +++ b/test/Client_test.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'package:flutter_test/flutter_test.dart'; import 'package:famedlysdk/src/Client.dart'; import 'package:famedlysdk/src/Connection.dart'; diff --git a/test/FakeMatrixApi.dart b/test/FakeMatrixApi.dart index 7c65576..9d3192f 100644 --- a/test/FakeMatrixApi.dart +++ b/test/FakeMatrixApi.dart @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2019 Zender & Kurtz GbR. + * + * Authors: + * Christian Pauly + * Marcel Radzio + * + * This file is part of famedlysdk. + * + * famedlysdk is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * famedlysdk is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see . + */ + import 'package:http/testing.dart'; import 'dart:convert'; import 'dart:core';