move to new sdk
This commit is contained in:
parent
7e3d330a68
commit
6868f38c7c
26 changed files with 172 additions and 201 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:bubble/bubble.dart';
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:famedlysdk/encryption.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
import 'package:fluffychat/components/message_content.dart';
|
||||
import 'package:fluffychat/components/reply_content.dart';
|
||||
|
|
@ -98,11 +99,11 @@ class Message extends StatelessWidget {
|
|||
['m.in_reply_to']['event_id'],
|
||||
content: {'msgtype': 'm.text', 'body': '...'},
|
||||
senderId: event.senderId,
|
||||
typeKey: 'm.room.message',
|
||||
type: 'm.room.message',
|
||||
room: event.room,
|
||||
roomId: event.roomId,
|
||||
status: 1,
|
||||
time: DateTime.now(),
|
||||
originServerTs: DateTime.now(),
|
||||
);
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 4.0),
|
||||
|
|
@ -218,7 +219,7 @@ class _MetaRow extends StatelessWidget {
|
|||
),
|
||||
if (showDisplayname) SizedBox(width: 4),
|
||||
Text(
|
||||
event.time.localizedTime(context),
|
||||
event.originServerTs.localizedTime(context),
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontSize: 11,
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ class PresenceListItem extends StatelessWidget {
|
|||
static final Map<String, Profile> _presences = {};
|
||||
|
||||
Future<Profile> _requestProfile(BuildContext context) async {
|
||||
_presences[presence.sender] ??=
|
||||
await Matrix.of(context).client.getProfileFromUserId(presence.sender);
|
||||
return _presences[presence.sender];
|
||||
_presences[presence.senderId] ??=
|
||||
await Matrix.of(context).client.getProfileFromUserId(presence.senderId);
|
||||
return _presences[presence.senderId];
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -25,7 +25,7 @@ class PresenceListItem extends StatelessWidget {
|
|||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) return Container();
|
||||
Uri avatarUrl;
|
||||
var displayname = presence.sender.localpart;
|
||||
var displayname = presence.senderId.localpart;
|
||||
if (snapshot.hasData) {
|
||||
avatarUrl = snapshot.data.avatarUrl;
|
||||
displayname = snapshot.data.displayname;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:famedlysdk/matrix_api.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
|
@ -6,15 +7,16 @@ import '../../l10n/l10n.dart';
|
|||
import '../../utils/app_route.dart';
|
||||
import '../../views/chat.dart';
|
||||
import '../avatar.dart';
|
||||
import '../matrix.dart';
|
||||
|
||||
class PublicRoomListItem extends StatelessWidget {
|
||||
final PublicRoomEntry publicRoomEntry;
|
||||
final PublicRoom publicRoomEntry;
|
||||
|
||||
const PublicRoomListItem(this.publicRoomEntry, {Key key}) : super(key: key);
|
||||
|
||||
void joinAction(BuildContext context) async {
|
||||
final success = await SimpleDialogs(context)
|
||||
.tryRequestWithLoadingDialog(publicRoomEntry.join());
|
||||
final success = await SimpleDialogs(context).tryRequestWithLoadingDialog(
|
||||
Matrix.of(context).client.api.joinRoom(publicRoomEntry.roomId));
|
||||
if (success != false) {
|
||||
await Navigator.of(context).push(
|
||||
AppRoute.defaultRoute(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue