Browse Source

Update Goldens

custom_profile_images
Sarah Jamie Lewis 4 months ago
parent
commit
62bca86c19
  1. 14
      lib/cwtch/cwtchNotifier.dart
  2. 3
      lib/views/addeditprofileview.dart
  3. BIN
      test/profileimage_init.png

14
lib/cwtch/cwtchNotifier.dart

@ -259,12 +259,14 @@ class CwtchNotifier {
case "UpdatedProfileAttribute":
if (data["Key"] == "public.profile.name") {
profileCN.getProfile(data["ProfileOnion"])?.nickname = data["Data"];
} else if (data["Key"].toString().startsWith("local.filesharing.") && data["Key"].toString().endsWith(".path")) {
// local.conversation.filekey.path
List<String> keyparts = data["Key"].toString().split(".");
if (keyparts.length == 5) {
String filekey = keyparts[2] + "." + keyparts[3];
profileCN.getProfile(data["ProfileOnion"])?.downloadSetPathForSender(filekey, data["Data"]);
} else if (data["Key"].toString().startsWith("local.filesharing.")) {
if (data["Key"].toString().endsWith(".path")) {
// local.conversation.filekey.path
List<String> keyparts = data["Key"].toString().split(".");
if (keyparts.length == 5) {
String filekey = keyparts[2] + "." + keyparts[3];
profileCN.getProfile(data["ProfileOnion"])?.downloadSetPathForSender(filekey, data["Data"]);
}
}
} else {
EnvironmentConfig.debugLog("unhandled set attribute event: ${data['Key']}");

3
lib/views/addeditprofileview.dart

@ -94,7 +94,8 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
cursor: Provider.of<Settings>(context).isExperimentEnabled(ImagePreviewsExperiment) ? SystemMouseCursors.click : SystemMouseCursors.basic,
child: GestureDetector(
// don't allow setting of profile images if the image previews experiment is disabled.
onTap: Provider.of<AppState>(context, listen: false).disableFilePicker || !Provider.of<Settings>(context, listen: false).isExperimentEnabled(ImagePreviewsExperiment)
onTap: Provider.of<AppState>(context, listen: false).disableFilePicker ||
!Provider.of<Settings>(context, listen: false).isExperimentEnabled(ImagePreviewsExperiment)
? null
: () {
filesharing.showFilePicker(context, MaxImageFileSharingSize, (File file) {

BIN
test/profileimage_init.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Loading…
Cancel
Save