New Cwtch Library Integration #258
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'package:cwtch/main.dart';
|
||||||
import 'package:cwtch/models/message.dart';
|
import 'package:cwtch/models/message.dart';
|
||||||
import 'package:cwtch/models/profileservers.dart';
|
import 'package:cwtch/models/profileservers.dart';
|
||||||
import 'package:cwtch/models/servers.dart';
|
import 'package:cwtch/models/servers.dart';
|
||||||
|
@ -365,6 +366,8 @@ class CwtchNotifier {
|
||||||
case "FileDownloaded":
|
case "FileDownloaded":
|
||||||
profileCN.getProfile(data["ProfileOnion"])?.downloadMarkFinished(data["FileKey"], data["FilePath"]);
|
profileCN.getProfile(data["ProfileOnion"])?.downloadMarkFinished(data["FileKey"], data["FilePath"]);
|
||||||
break;
|
break;
|
||||||
|
case "ImportingProfileEvent":
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
EnvironmentConfig.debugLog("unhandled event: $type");
|
EnvironmentConfig.debugLog("unhandled event: $type");
|
||||||
}
|
}
|
||||||
|
|
|
@ -631,7 +631,7 @@ class ContactInfoState extends ChangeNotifier {
|
||||||
set newMarker(int newVal) {
|
set newMarker(int newVal) {
|
||||||
// only unreadMessages++ can set newMarker = 1;
|
// only unreadMessages++ can set newMarker = 1;
|
||||||
// avoids drawing a marker when the convo is already open
|
// avoids drawing a marker when the convo is already open
|
||||||
if (newVal > 1) {
|
if (newVal >= 1) {
|
||||||
this._newMarker = newVal;
|
this._newMarker = newVal;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
var mark = Provider.of<ContactInfoState>(context).newMarker;
|
var mark = Provider.of<ContactInfoState>(context).newMarker;
|
||||||
if (mark > 0 &&
|
if (mark > 0 &&
|
||||||
Provider.of<ContactInfoState>(context).messageCache.length > mark &&
|
Provider.of<ContactInfoState>(context).messageCache.length > mark &&
|
||||||
Provider.of<ContactInfoState>(context).messageCache[mark]?.metadata.messageID == Provider.of<MessageMetadata>(context).messageID) {
|
Provider.of<ContactInfoState>(context).messageCache[mark - 1]?.metadata.messageID == Provider.of<MessageMetadata>(context).messageID) {
|
||||||
return Column(crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start, children: [Align(alignment: Alignment.center, child: _bubbleNew()), mr]);
|
return Column(crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start, children: [Align(alignment: Alignment.center, child: _bubbleNew()), mr]);
|
||||||
} else {
|
} else {
|
||||||
return mr;
|
return mr;
|
||||||
|
|
Loading…
Reference in New Issue