Fix #295 - Clicking on an Avatar in P2P Chat should not result in an action
This commit is contained in:
parent
e12b744e68
commit
306a9c4de5
|
@ -55,6 +55,7 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var fromMe = Provider.of<MessageMetadata>(context).senderHandle == Provider.of<ProfileInfoState>(context).onion;
|
var fromMe = Provider.of<MessageMetadata>(context).senderHandle == Provider.of<ProfileInfoState>(context).onion;
|
||||||
var isContact = Provider.of<ProfileInfoState>(context).contactList.findContact(Provider.of<MessageMetadata>(context).senderHandle) != null;
|
var isContact = Provider.of<ProfileInfoState>(context).contactList.findContact(Provider.of<MessageMetadata>(context).senderHandle) != null;
|
||||||
|
var isGroup = Provider.of<ProfileInfoState>(context).contactList.getContact(Provider.of<MessageMetadata>(context, listen: false).conversationIdentifier)!.isGroup;
|
||||||
var isBlocked = isContact ? Provider.of<ProfileInfoState>(context).contactList.findContact(Provider.of<MessageMetadata>(context).senderHandle)!.isBlocked : false;
|
var isBlocked = isContact ? Provider.of<ProfileInfoState>(context).contactList.findContact(Provider.of<MessageMetadata>(context).senderHandle)!.isBlocked : false;
|
||||||
var actualMessage = Flexible(flex: Platform.isAndroid ? 10 : 3, fit: FlexFit.loose, child: widget.child);
|
var actualMessage = Flexible(flex: Platform.isAndroid ? 10 : 3, fit: FlexFit.loose, child: widget.child);
|
||||||
|
|
||||||
|
@ -148,17 +149,24 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
|
||||||
} else {
|
} else {
|
||||||
var contact = Provider.of<ContactInfoState>(context);
|
var contact = Provider.of<ContactInfoState>(context);
|
||||||
Widget wdgPortrait = GestureDetector(
|
Widget wdgPortrait = GestureDetector(
|
||||||
onTap: isContact ? _btnGoto : _btnAdd,
|
onTap: !isGroup
|
||||||
|
? null
|
||||||
|
: isContact
|
||||||
|
? _btnGoto
|
||||||
|
: _btnAdd,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(4.0),
|
padding: EdgeInsets.all(4.0),
|
||||||
child: ProfileImage(
|
child: ProfileImage(
|
||||||
diameter: 48.0,
|
diameter: 48.0,
|
||||||
imagePath: Provider.of<MessageMetadata>(context).senderImage ?? contact.imagePath,
|
imagePath: Provider.of<MessageMetadata>(context).senderImage ?? contact.imagePath,
|
||||||
//maskOut: contact.status != "Authenticated",
|
|
||||||
border: contact.status == "Authenticated" ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor,
|
border: contact.status == "Authenticated" ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor,
|
||||||
badgeTextColor: Colors.red,
|
badgeTextColor: Colors.red,
|
||||||
badgeColor: Colors.red,
|
badgeColor: Colors.red,
|
||||||
tooltip: isContact ? AppLocalizations.of(context)!.contactGoto.replaceFirst("%1", senderDisplayStr) : AppLocalizations.of(context)!.addContact,
|
tooltip: !isGroup
|
||||||
|
? ""
|
||||||
|
: isContact
|
||||||
|
? AppLocalizations.of(context)!.contactGoto.replaceFirst("%1", senderDisplayStr)
|
||||||
|
: AppLocalizations.of(context)!.addContact,
|
||||||
)));
|
)));
|
||||||
|
|
||||||
widgetRow = <Widget>[
|
widgetRow = <Widget>[
|
||||||
|
|
Loading…
Reference in New Issue