forked from cwtch.im/cwtch-ui
Formatting
This commit is contained in:
parent
0fe6f21a75
commit
19f73eb075
|
@ -68,4 +68,4 @@ class AppState extends ChangeNotifier {
|
|||
}
|
||||
|
||||
bool isLandscape(BuildContext c) => MediaQuery.of(c).size.width > MediaQuery.of(c).size.height;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ class ChatMessage {
|
|||
d = json['d'];
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'o': o,
|
||||
'd': d,
|
||||
};
|
||||
}
|
||||
'o': o,
|
||||
'd': d,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -32,17 +32,17 @@ class ContactInfoState extends ChangeNotifier {
|
|||
|
||||
ContactInfoState(this.profileOnion, this.identifier, this.onion,
|
||||
{nickname = "",
|
||||
isGroup = false,
|
||||
accepted = false,
|
||||
blocked = false,
|
||||
status = "",
|
||||
imagePath = "",
|
||||
savePeerHistory = "DeleteHistoryConfirmed",
|
||||
numMessages = 0,
|
||||
numUnread = 0,
|
||||
lastMessageTime,
|
||||
server,
|
||||
archived = false}) {
|
||||
isGroup = false,
|
||||
accepted = false,
|
||||
blocked = false,
|
||||
status = "",
|
||||
imagePath = "",
|
||||
savePeerHistory = "DeleteHistoryConfirmed",
|
||||
numMessages = 0,
|
||||
numUnread = 0,
|
||||
lastMessageTime,
|
||||
server,
|
||||
archived = false}) {
|
||||
this._nickname = nickname;
|
||||
this._isGroup = isGroup;
|
||||
this._accepted = accepted;
|
||||
|
@ -211,4 +211,4 @@ class ContactInfoState extends ChangeNotifier {
|
|||
this.messageCache.firstWhere((element) => element?.metadata.messageID == messageID)?.metadata.ackd = true;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,4 +122,4 @@ class ContactListState extends ChangeNotifier {
|
|||
int idx = _contacts.indexWhere((element) => element.onion == byHandle);
|
||||
return idx >= 0 ? _contacts[idx] : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,4 +24,4 @@ String prettyBytes(int bytes) {
|
|||
} else {
|
||||
return bytes.toString() + " B";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,4 +4,4 @@ class MessageCache {
|
|||
final MessageMetadata metadata;
|
||||
final String wrapper;
|
||||
MessageCache(this.metadata, this.wrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,21 +152,21 @@ class ProfileInfoState extends ChangeNotifier {
|
|||
profileContact.lastMessageTime = DateTime.fromMillisecondsSinceEpoch(1000 * int.parse(contact["lastMsgTime"]));
|
||||
} else {
|
||||
this._contacts.add(ContactInfoState(
|
||||
this.onion,
|
||||
contact["identifier"],
|
||||
contact["onion"],
|
||||
nickname: contact["name"],
|
||||
status: contact["status"],
|
||||
imagePath: contact["picture"],
|
||||
accepted: contact["accepted"],
|
||||
blocked: contact["blocked"],
|
||||
savePeerHistory: contact["saveConversationHistory"],
|
||||
numMessages: contact["numMessages"],
|
||||
numUnread: contact["numUnread"],
|
||||
isGroup: contact["isGroup"],
|
||||
server: contact["groupServer"],
|
||||
lastMessageTime: DateTime.fromMillisecondsSinceEpoch(1000 * int.parse(contact["lastMsgTime"])),
|
||||
));
|
||||
this.onion,
|
||||
contact["identifier"],
|
||||
contact["onion"],
|
||||
nickname: contact["name"],
|
||||
status: contact["status"],
|
||||
imagePath: contact["picture"],
|
||||
accepted: contact["accepted"],
|
||||
blocked: contact["blocked"],
|
||||
savePeerHistory: contact["saveConversationHistory"],
|
||||
numMessages: contact["numMessages"],
|
||||
numUnread: contact["numUnread"],
|
||||
isGroup: contact["isGroup"],
|
||||
server: contact["groupServer"],
|
||||
lastMessageTime: DateTime.fromMillisecondsSinceEpoch(1000 * int.parse(contact["lastMsgTime"])),
|
||||
));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -269,4 +269,4 @@ class ProfileInfoState extends ChangeNotifier {
|
|||
}
|
||||
return prettyBytes((bytes / seconds).round()) + "/s";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,4 +27,4 @@ class ProfileListState extends ChangeNotifier {
|
|||
_profiles.removeWhere((element) => element.onion == onion);
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:cwtch/models/profile.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
||||
bool noFilter(ContactInfoState peer) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue