Skip to content

Commit

Permalink
fix: add back official upload image
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Sep 22, 2023
1 parent 3d16988 commit 717acd3
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public class ImageUpdater implements NotificationCenter.NotificationCenterDelega
ID_SEARCH_WEB = 2,
ID_REMOVE_PHOTO = 3,
ID_RECORD_VIDEO = 4,
ID_OPEN_AVATAR = 5;
ID_OPEN_AVATAR = 5,
ID_OPEN_ATTACH = 6;

public final static int FOR_TYPE_USER = 0;
public final static int FOR_TYPE_CHANNEL = 1;
Expand Down Expand Up @@ -273,6 +274,10 @@ public void openMenu(boolean hasAvatar, Runnable onDeleteAvatar, DialogInterface
icons.add(R.drawable.msg_photos);
ids.add(ID_UPLOAD_FROM_GALLERY);

items.add(LocaleController.getString("UploadImage", R.string.UploadImage));
icons.add(R.drawable.msg_photos);
ids.add(ID_OPEN_ATTACH);

items.add(LocaleController.getString("ChooseTakePhoto", R.string.ChooseTakePhoto));
icons.add(R.drawable.msg_camera);
ids.add(ID_TAKE_PHOTO);
Expand Down Expand Up @@ -302,6 +307,9 @@ public void openMenu(boolean hasAvatar, Runnable onDeleteAvatar, DialogInterface
builder.setItems(items.toArray(new CharSequence[0]), iconsRes, (dialogInterface, i) -> {
int id = ids.get(i);
switch (id) {
case ID_OPEN_ATTACH:
openAttachMenu(onDismiss);
break;
case ID_OPEN_AVATAR:
TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(UserConfig.getInstance(currentAccount).getClientUserId());
if (user != null && user.photo != null && user.photo.photo_big != null) {
Expand Down

0 comments on commit 717acd3

Please sign in to comment.