Update to version 0.11.0

This commit is contained in:
Christian Pauly 2020-04-02 13:14:39 +02:00
parent 45cf9a74e8
commit 4bf7cb9f4b
6 changed files with 37 additions and 15 deletions

View File

@ -1,3 +1,7 @@
# Version 0.11.0 - 2020-04-02
### Fixes:
- Minor bugfixes
# Version 0.10.1 - 2020-03-29
### Fixes:
- Fix a lazy loading bug

View File

@ -67,7 +67,7 @@ class _ChatState extends State<_Chat> {
Timer typingTimeout;
bool currentlyTyping = false;
Set<Event> selectedEvents = {};
List<Event> selectedEvents = [];
Event replyEvent;
@ -261,6 +261,9 @@ class _ChatState extends State<_Chat> {
String _getSelectedEventString(BuildContext context) {
String copyString = "";
if (selectedEvents.length == 1) {
return selectedEvents.first.getLocalizedBody(context);
}
for (Event event in selectedEvents) {
if (copyString.isNotEmpty) copyString += "\n\n";
copyString += event.getLocalizedBody(context, withSenderNamePrefix: true);
@ -488,13 +491,22 @@ class _ChatState extends State<_Chat> {
),
)
: Message(timeline.events[i - 1],
onSelect: (Event event) => event.redacted
? null
: selectedEvents.contains(event)
? setState(() =>
selectedEvents.remove(event))
: setState(() =>
selectedEvents.add(event)),
onSelect: (Event event) {
if (!event.redacted) {
if (selectedEvents.contains(event)) {
setState(
() => selectedEvents.remove(event),
);
} else {
setState(
() => selectedEvents.add(event),
);
}
selectedEvents.sort(
(a, b) => a.time.compareTo(b.time),
);
}
},
longPressSelect: selectedEvents.isEmpty,
selected: selectedEvents
.contains(timeline.events[i - 1]),

View File

@ -174,6 +174,7 @@ class _ChatDetailsState extends State<ChatDetails> {
);
}
members ??= widget.room.getParticipants();
members.removeWhere((u) => u.membership == Membership.leave);
final int actualMembersCount =
widget.room.mInvitedMemberCount + widget.room.mJoinedMemberCount;
final bool canRequestMoreMembers = members.length < actualMembersCount;

View File

@ -27,10 +27,14 @@ class _InvitationSelectionState extends State<InvitationSelection> {
Future<List<User>> getContacts(BuildContext context) async {
final Client client = Matrix.of(context).client;
List<User> participants = await widget.room.requestParticipants();
participants.removeWhere(
(u) => ![Membership.join, Membership.invite].contains(u.membership),
);
List<User> contacts = [];
Map<String, bool> userMap = {};
for (int i = 0; i < client.rooms.length; i++) {
List<User> roomUsers = client.rooms[i].getParticipants();
for (int j = 0; j < roomUsers.length; j++) {
if (userMap[roomUsers[j].id] != true &&
participants.indexWhere((u) => u.id == roomUsers[j].id) == -1) {
@ -39,10 +43,11 @@ class _InvitationSelectionState extends State<InvitationSelection> {
userMap[roomUsers[j].id] = true;
}
}
contacts.sort((a, b) => a
.calcDisplayname()
.toLowerCase()
.compareTo(b.calcDisplayname().toLowerCase()));
contacts.sort(
(a, b) => a.calcDisplayname().toLowerCase().compareTo(
b.calcDisplayname().toLowerCase(),
),
);
return contacts;
}

View File

@ -124,8 +124,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: eb66ec79d431c73d5d752cb237b94da56b92f10f
resolved-ref: eb66ec79d431c73d5d752cb237b94da56b92f10f
ref: "63a5d5dba37bdf3d1106fdf6f11760bfd7d2904c"
resolved-ref: "63a5d5dba37bdf3d1106fdf6f11760bfd7d2904c"
url: "https://gitlab.com/famedly/famedlysdk.git"
source: git
version: "0.0.1"

View File

@ -11,7 +11,7 @@ description: Chat with your friends.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.10.0+30
version: 0.11.0+31
environment:
sdk: ">=2.6.0 <3.0.0"