add contact names to message bubbles #69
|
@ -147,7 +147,7 @@ class CwtchNotifier {
|
|||
case "ServerStateChange":
|
||||
print("server state change: $data");
|
||||
profileCN.getProfile(data["ProfileOnion"]).contactList.contacts.forEach((contact) {
|
||||
if (contact.isGroup && contact.server == data["GroupServer"]) {
|
||||
if (contact.isGroup == true && contact.server == data["GroupServer"]) {
|
||||
print("server state change: $data " + contact.server);
|
||||
contact.status = data["ConnectionState"];
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class _MessageViewState extends State<MessageView> {
|
|||
void _pushContactSettings() {
|
||||
Navigator.of(context).push(MaterialPageRoute<void>(
|
||||
builder: (BuildContext bcontext) {
|
||||
if (Provider.of<ContactInfoState>(context, listen: false).isGroup) {
|
||||
if (Provider.of<ContactInfoState>(context, listen: false).isGroup == true) {
|
||||
return MultiProvider(
|
||||
providers: [ChangeNotifierProvider.value(value: Provider.of<ContactInfoState>(context))],
|
||||
child: GroupSettingsView(),
|
||||
|
|
|
@ -25,7 +25,16 @@ class MessageBubbleState extends State<MessageBubble> {
|
|||
prettyDate = DateFormat.yMd().add_jm().format(Provider.of<MessageState>(context).timestamp);
|
||||
}
|
||||
|
||||
var wdgSender = Text(Provider.of<MessageState>(context).senderOnion ?? "",
|
||||
var senderDisplayStr = "";
|
||||
if (Provider.of<MessageState>(context).senderOnion != null) {
|
||||
var contact = Provider.of<ProfileInfoState>(context).contactList.getContact(Provider.of<MessageState>(context).senderOnion);
|
||||
if (contact == null) {
|
||||
senderDisplayStr = Provider.of<MessageState>(context).senderOnion;
|
||||
} else {
|
||||
senderDisplayStr = contact.nickname ?? contact.onion;
|
||||
}
|
||||
}
|
||||
var wdgSender = SelectableText(senderDisplayStr,
|
||||
style: TextStyle(fontSize: 9.0, color: fromMe ? Provider.of<Settings>(context).theme.messageFromMeTextColor() : Provider.of<Settings>(context).theme.messageFromOtherTextColor()));
|
||||
|
||||
var wdgMessage = SelectableText(
|
||||
|
|
Loading…
Reference in New Issue