aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhristoterezov <hristo@jitsi.org>2014-02-13 12:24:06 +0200
committerhristoterezov <hristo@jitsi.org>2014-02-13 12:24:06 +0200
commit9ec8bbdef5292aace4a9fb4a11a674aa066ca1cf (patch)
tree3dcf79afabddb313a1f4fb35cf88419ebb321945
parent73487644d4174b601741d2ed985edd1572c844eb (diff)
downloadjitsi-9ec8bbdef5292aace4a9fb4a11a674aa066ca1cf.zip
jitsi-9ec8bbdef5292aace4a9fb4a11a674aa066ca1cf.tar.gz
jitsi-9ec8bbdef5292aace4a9fb4a11a674aa066ca1cf.tar.bz2
Adds configuration property to hide remove chat room right hand menu item if the property is true and the user is owner of the room.
-rw-r--r--src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java42
1 files changed, 33 insertions, 9 deletions
diff --git a/src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java b/src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java
index c144072..154a3d5 100644
--- a/src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java
+++ b/src/net/java/sip/communicator/impl/muc/MUCCustomContactActionService.java
@@ -38,6 +38,12 @@ public class MUCCustomContactActionService
= new LinkedList<ContactAction<SourceContact>>();
/**
+ *
+ */
+ private static final String OWNER_CANT_REMOVE_CHATROOM_PROPERTY
+ = "net.sip.communicator.impl.muc.OWNER_CANT_REMOVE_CHATROOM";
+
+ /**
* Array of names for the custom actions.
*/
private String[] actionsNames = {
@@ -651,27 +657,45 @@ public class MUCCustomContactActionService
if(!(actionSource instanceof ChatRoomSourceContact))
return false;
+ ChatRoomSourceContact contact
+ = (ChatRoomSourceContact) actionSource;
+ ChatRoomWrapper room = MUCActivator.getMUCService()
+ .findChatRoomWrapperFromSourceContact(contact);
if(name.equals("autojoin") || name.equals("autojoin_pressed"))
{
- ChatRoomSourceContact contact
- = (ChatRoomSourceContact) actionSource;
- ChatRoomWrapper room = MUCActivator.getMUCService()
- .findChatRoomWrapperFromSourceContact(contact);
+
if(name.equals("autojoin"))
return !room.isAutojoin();
if(name.equals("autojoin_pressed"))
return room.isAutojoin();
}
+ else if(name.equals("remove"))
+ {
+ if(room == null || room.getChatRoom() == null)
+ return true;
+
+ if(room.getChatRoom().getUserRole().equals(
+ ChatRoomMemberRole.OWNER))
+ {
+ if(MUCActivator.getConfigurationService().getBoolean(
+ OWNER_CANT_REMOVE_CHATROOM_PROPERTY, false))
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ return true;
+ }
else if(name.equals("destroy_chatroom"))
{
- ChatRoomSourceContact contact
- = (ChatRoomSourceContact) actionSource;
- ChatRoomWrapper room = MUCActivator.getMUCService()
- .findChatRoomWrapperFromSourceContact(contact);
if(room == null || room.getChatRoom() == null)
return false;
- if(room.getChatRoom().getUserRole().equals(ChatRoomMemberRole.OWNER))
+ if(room.getChatRoom().getUserRole().equals(
+ ChatRoomMemberRole.OWNER))
return true;
return false;
}