-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wording and add room service methods counters, history
- Loading branch information
Sebastien Dugene
committed
May 21, 2020
1 parent
88b43a5
commit ddf40fc
Showing
8 changed files
with
220 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.0.7 | ||
|
||
* Fix wording and add room service methods counters, history | ||
|
||
## 0.0.6 | ||
|
||
* Fix NPE on filter | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:rocket_chat_connector_flutter/models/filters/room_filter.dart'; | ||
import 'package:rocket_chat_connector_flutter/models/room.dart'; | ||
|
||
import '../user.dart'; | ||
|
||
class RoomCountersFilter extends RoomFilter { | ||
User user; | ||
|
||
RoomCountersFilter(Room room, {this.user}) : super(room); | ||
|
||
Map<String, dynamic> toMap() => { | ||
'roomId': room.id, | ||
'userId': user != null ? user.id : null, | ||
}; | ||
|
||
@override | ||
String toString() { | ||
return 'RoomCountersFilter{user: $user}'; | ||
} | ||
|
||
@override | ||
bool operator ==(Object other) => | ||
identical(this, other) || | ||
super == other && | ||
other is RoomCountersFilter && | ||
runtimeType == other.runtimeType && | ||
user == other.user; | ||
|
||
@override | ||
int get hashCode => super.hashCode ^ user.hashCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:rocket_chat_connector_flutter/models/filters/filter.dart'; | ||
import 'package:rocket_chat_connector_flutter/models/room.dart'; | ||
|
||
class RoomFilter extends Filter { | ||
Room room; | ||
|
||
RoomFilter(this.room); | ||
|
||
Map<String, dynamic> toMap() => { | ||
'roomId': room.id, | ||
}; | ||
|
||
@override | ||
String toString() { | ||
return 'RoomFilter{room: $room}'; | ||
} | ||
|
||
@override | ||
bool operator ==(Object other) => | ||
identical(this, other) || | ||
other is RoomFilter && | ||
runtimeType == other.runtimeType && | ||
room == other.room; | ||
|
||
@override | ||
int get hashCode => room.hashCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import 'package:rocket_chat_connector_flutter/models/filters/room_filter.dart'; | ||
import 'package:rocket_chat_connector_flutter/models/room.dart'; | ||
|
||
class RoomHistoryFilter extends RoomFilter { | ||
DateTime latest; | ||
DateTime oldest; | ||
bool inclusive; | ||
int offset; | ||
int count; | ||
bool unreads; | ||
|
||
RoomHistoryFilter( | ||
Room room, { | ||
this.latest, | ||
this.oldest, | ||
this.inclusive, | ||
this.offset, | ||
this.count, | ||
this.unreads, | ||
}) : super(room); | ||
|
||
Map<String, dynamic> toMap() => { | ||
'roomId': room.id, | ||
'latest': latest != null ? latest.toIso8601String() : null, | ||
'oldest': oldest != null ? oldest.toIso8601String() : null, | ||
'inclusive': inclusive, | ||
'offset': offset, | ||
'count': count, | ||
'unreads': unreads | ||
}; | ||
|
||
@override | ||
String toString() { | ||
return 'RoomHistoryFilter{latest: $latest, oldest: $oldest, inclusive: $inclusive, offset: $offset, count: $count, unreads: $unreads}'; | ||
} | ||
|
||
@override | ||
bool operator ==(Object other) => | ||
identical(this, other) || | ||
super == other && | ||
other is RoomHistoryFilter && | ||
runtimeType == other.runtimeType && | ||
latest == other.latest && | ||
oldest == other.oldest && | ||
inclusive == other.inclusive && | ||
offset == other.offset && | ||
count == other.count && | ||
unreads == other.unreads; | ||
|
||
@override | ||
int get hashCode => | ||
super.hashCode ^ | ||
latest.hashCode ^ | ||
oldest.hashCode ^ | ||
inclusive.hashCode ^ | ||
offset.hashCode ^ | ||
count.hashCode ^ | ||
unreads.hashCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters