mirror of
https://github.com/igniterealtime/Spark.git
synced 2026-08-18 11:10:02 +00:00
SubjectPanel: Show room name instead of JID, Fastpath: set subject
This commit is contained in:
@ -115,7 +115,7 @@ public class GroupChatRoom extends ChatRoom {
|
||||
|
||||
setupListeners();
|
||||
|
||||
subjectPanel = new SubjectPanel(this);
|
||||
subjectPanel = new SubjectPanel(roomBareJid, tabTitle, chat.getSubject());
|
||||
// Do not show the top toolbar
|
||||
getToolBar().add(subjectPanel,
|
||||
new GridBagConstraints(0, 1, 1, 1, 1, 0,
|
||||
@ -791,10 +791,10 @@ public class GroupChatRoom extends ChatRoom {
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the label that is displayed for this room. Does not send an update to the XMPP server (UI only).
|
||||
* Changes the subject that is displayed for this room. Does not send an update to the XMPP server (UI only).
|
||||
*/
|
||||
public void setRoomLabel(String label) {
|
||||
subjectPanel.setRoomLabel(label);
|
||||
public void setRoomSubject(String subject) {
|
||||
subjectPanel.setSubject(subject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -15,17 +15,17 @@ public class SubjectPanel extends JPanel
|
||||
private final JLabel roomJIDLabel;
|
||||
private final JLabel subjectLabel;
|
||||
|
||||
public SubjectPanel( GroupChatRoom groupChatRoom )
|
||||
public SubjectPanel(EntityBareJid roomJid, String roomName, String subject)
|
||||
{
|
||||
setLayout( new GridBagLayout() );
|
||||
EntityBareJid roomJid = groupChatRoom.getBareJid();
|
||||
roomJIDLabel = new JLabel( "<" + roomJid + ">" );
|
||||
roomJIDLabel = new JLabel(roomName);
|
||||
roomJIDLabel.setFont( roomJIDLabel.getFont().deriveFont( Font.BOLD ) );
|
||||
if (SettingsManager.getLocalPreferences().isMucRandomColors()) {
|
||||
roomJIDLabel.setForeground(XEP0392Utils.colorOfMuc(roomJid));
|
||||
}
|
||||
roomJIDLabel.setToolTipText("xmpp:" + roomJid + "?join");
|
||||
|
||||
subjectLabel = new JLabel( groupChatRoom.getMultiUserChat().getSubject() );
|
||||
subjectLabel = new JLabel(subject);
|
||||
|
||||
add( roomJIDLabel,
|
||||
new GridBagConstraints( 1, 0, 1, 1, 1.0, 0.0,
|
||||
@ -47,8 +47,4 @@ public class SubjectPanel extends JPanel
|
||||
this.setToolTipText( subject );
|
||||
}
|
||||
|
||||
public void setRoomLabel( String label )
|
||||
{
|
||||
roomJIDLabel.setText( label );
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,9 +31,7 @@ import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.MessageBuilder;
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
import org.jivesoftware.smack.packet.StanzaBuilder;
|
||||
import org.jivesoftware.smackx.muc.MultiUserChat;
|
||||
import org.jivesoftware.smackx.workgroup.MetaData;
|
||||
import org.jivesoftware.smackx.workgroup.agent.*;
|
||||
@ -566,7 +564,7 @@ public class Workpane {
|
||||
SparkManager.getChatManager().notifySparkTabHandlers(groupChatRoom);
|
||||
|
||||
// Change the subject line.
|
||||
groupChatRoom.setRoomLabel("<html><body><b>Fastpath Conversation with " + roomName + "</b></body></html>");
|
||||
groupChatRoom.setRoomSubject("<html><body><b>Fastpath Conversation</b></body></html>");
|
||||
return true;
|
||||
}
|
||||
else if (message != null) {
|
||||
|
||||
Reference in New Issue
Block a user