Merge branch 'fix-photo-deleting' into 'dev'

Fix Photo Deleting when the photo isn't owned by the user.

See merge request morningstar/Arcturus-Community!227
This commit is contained in:
Harmonic 2020-06-05 04:06:21 -04:00
commit d44d7fe162

View File

@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.rooms.items;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.items.interactions.InteractionExternalImage;
import com.eu.habbo.habbohotel.items.interactions.InteractionPostIt;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.incoming.MessageHandler;
@ -22,7 +23,7 @@ public class PostItDeleteEvent extends MessageHandler {
HabboItem item = room.getHabboItem(itemId);
if (item instanceof InteractionPostIt || item instanceof InteractionExternalImage) {
if (item.getUserId() == this.client.getHabbo().getHabboInfo().getId() || room.isOwner(this.client.getHabbo())) {
if (item.getUserId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) {
item.setRoomId(0);
room.removeHabboItem(item);
room.sendComposer(new RemoveWallItemComposer(item).compose());