mirror of https://github.com/M66B/FairEmail.git
Allow removing avatars
This commit is contained in:
parent
5677c283e3
commit
d71bddf958
|
@ -202,6 +202,8 @@ public class EntityMessage implements Serializable {
|
||||||
void getAvatar(Context context) {
|
void getAvatar(Context context) {
|
||||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS)
|
if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS)
|
||||||
== PackageManager.PERMISSION_GRANTED) {
|
== PackageManager.PERMISSION_GRANTED) {
|
||||||
|
this.avatar = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.from != null)
|
if (this.from != null)
|
||||||
for (int i = 0; i < this.from.length; i++) {
|
for (int i = 0; i < this.from.length; i++) {
|
||||||
|
|
|
@ -2167,11 +2167,10 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
Log.i(Helper.TAG, folder.name + " updated id=" + message.id + " uid=" + message.uid + " unhide");
|
Log.i(Helper.TAG, folder.name + " updated id=" + message.id + " uid=" + message.uid + " unhide");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TextUtils.isEmpty(message.avatar)) {
|
boolean noavatar = TextUtils.isEmpty(message.avatar);
|
||||||
message.getAvatar(context);
|
message.getAvatar(context);
|
||||||
if (!TextUtils.isEmpty(message.avatar))
|
if (noavatar != TextUtils.isEmpty(message.avatar))
|
||||||
update = true;
|
update = true;
|
||||||
}
|
|
||||||
|
|
||||||
if (update)
|
if (update)
|
||||||
db.message().updateMessage(message);
|
db.message().updateMessage(message);
|
||||||
|
|
Loading…
Reference in New Issue