mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
SPARK-1522: Configure room button to be displayed only if the user a room owner
also dialog window is resized to 230 as part of ticket 1521 git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@13606 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -880,7 +880,7 @@ public class LoginDialog {
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
final Dimension dim = super.getPreferredSize();
|
||||
dim.height = 250;
|
||||
dim.height = 230;
|
||||
return dim;
|
||||
}
|
||||
|
||||
|
||||
@ -212,6 +212,11 @@ public class GroupChatParticipantList extends JPanel implements
|
||||
|
||||
if (p.getType() == Presence.Type.available) {
|
||||
String jid = PresenceManager.getJidFromMUCPresence(p);
|
||||
//if current user is participant and not owner, then do not display the settings button
|
||||
//we have to do it here otherwise ownership information retrieval won't be available
|
||||
if (jid != null && jid.equals(SparkManager.getSessionManager().getBareAddress())) {
|
||||
groupChatRoom.notifySettingsAccessRight();
|
||||
}
|
||||
addParticipant(userid, p, jid);
|
||||
agentInfoPanel.setVisible(true);
|
||||
} else {
|
||||
|
||||
@ -121,7 +121,7 @@ public class GroupChatRoom extends ChatRoom {
|
||||
.isShowJoinLeaveMessagesEnabled();
|
||||
private boolean isMucHighlightingNameEnabled = pref.isMucHighNameEnabled();
|
||||
private boolean isMucHighlightingTextEnabled = pref.isMucHighTextEnabled();
|
||||
|
||||
private RolloverButton settings;
|
||||
|
||||
/**
|
||||
* Creates a GroupChatRoom from a <code>MultiUserChat</code>.
|
||||
@ -1370,7 +1370,8 @@ public class GroupChatRoom extends ChatRoom {
|
||||
*/
|
||||
private void addRoomConfigureButtons(GroupChatRoom room) {
|
||||
|
||||
RolloverButton settings = UIComponentRegistry.getButtonFactory().createSettingsButton();
|
||||
settings = UIComponentRegistry.getButtonFactory().createSettingsButton();
|
||||
settings.setVisible(false);
|
||||
RolloverButton thema = UIComponentRegistry.getButtonFactory().createTemaButton();
|
||||
RolloverButton register = UIComponentRegistry.getButtonFactory().createRegisterButton();
|
||||
|
||||
@ -1438,4 +1439,11 @@ public class GroupChatRoom extends ChatRoom {
|
||||
|
||||
}
|
||||
|
||||
public void notifySettingsAccessRight() {
|
||||
if(SparkManager.getUserManager().isOwner(
|
||||
(GroupChatRoom) getChatRoom(), chat.getNickname())) {
|
||||
settings.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user