hide "show chat history" button if chat history is disabled

Description

The button is always displayed, it would be nice if one would also hide it if no chat history is yet available but as this requires a file access it may be better to ignore this case and display an empty history.
But as soon as the history is disabled it makes no sense to open a window to display no history. If I remember right the button is not available in the chat window but in the roster window within the popup menu.

Environment

None

Activity

Show:
David Schuster
July 10, 2008, 4:31 PM

apply this patch to remove the icon from the context menu

Index: src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java
===================================================================
— src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java (revision 10653)
+++ src/java/org/jivesoftware/sparkimpl/plugin/transcripts/ChatTranscriptPlugin.java (working copy)
@@ -77,9 +77,10 @@

notificationDateFormatter = new SimpleDateFormat(dateFormat);

messageDateFormatter = new SimpleDateFormat(timeFormat);

-

  • final ContactList contactList = SparkManager.getWorkspace().getContactList();

-

+

+ final LocalPreferences localPreferences = SettingsManager.getLocalPreferences();

+

+ final ContactList contactList = SparkManager.getWorkspace().getContactList();

final Action viewHistoryAction = new AbstractAction() {

public void actionPerformed(ActionEvent actionEvent) {

@@ -96,7 +97,9 @@
contactList.addContextMenuListener(new ContextMenuListener() {

public void poppingUp(Object object, JPopupMenu popup) {

if (object instanceof ContactItem) {

  • popup.add(viewHistoryAction);

+ if (localPreferences.isChatHistoryEnabled()) {

+ popup.add(viewHistoryAction);

+ }

}

}

wroot
July 9, 2008, 6:33 PM

there is still "View Contact History" in contact's context menu

Andrew Seymour
July 9, 2008, 6:40 AM

Fixed, patch submitted by David Schuster.

Fixed

Priority

Minor

Assignee

Daniel Henninger

Reporter

LG