|
@@ -363,7 +363,8 @@ public class LoggingManager implements ConfigChangeListener {
|
363
|
363
|
|
364
|
364
|
@Handler
|
365
|
365
|
public void handleChannelOpened(final ChannelOpenedEvent event) {
|
366
|
|
- final String filename = locator.getLogFile(event.getChannel().getName());
|
|
366
|
+ final String filename = locator.getLogFile(event.getChannel());
|
|
367
|
+ System.out.println("\tChannel opened filename: " + filename);
|
367
|
368
|
|
368
|
369
|
if (autobackbuffer) {
|
369
|
370
|
showBackBuffer(event.getChannel().getWindowModel(), filename);
|
|
@@ -377,7 +378,7 @@ public class LoggingManager implements ConfigChangeListener {
|
377
|
378
|
|
378
|
379
|
@Handler
|
379
|
380
|
public void handleChannelClosed(final ChannelClosedEvent event) {
|
380
|
|
- final String filename = locator.getLogFile(event.getChannel().getName());
|
|
381
|
+ final String filename = locator.getLogFile(event.getChannel());
|
381
|
382
|
|
382
|
383
|
synchronized (FORMAT_LOCK) {
|
383
|
384
|
appendLine(filename, "*** Channel closed at: %s", OPENED_AT_FORMAT.format(new Date()));
|
|
@@ -558,18 +559,18 @@ public class LoggingManager implements ConfigChangeListener {
|
558
|
559
|
* @return True if the history is available, false otherwise
|
559
|
560
|
*/
|
560
|
561
|
protected boolean showHistory(final WindowModel target) {
|
561
|
|
- final String descriptor;
|
|
562
|
+ final Path log;
|
562
|
563
|
|
563
|
564
|
if (target instanceof GroupChat) {
|
564
|
|
- descriptor = target.getName();
|
|
565
|
+ log = Paths.get(locator.getLogFile((GroupChat)target));
|
565
|
566
|
} else if (target instanceof Query) {
|
566
|
|
- descriptor = ((PrivateChat) target).getNickname();
|
|
567
|
+ log = Paths.get(locator.getLogFile(((PrivateChat) target).getUser()));
|
567
|
568
|
} else {
|
568
|
569
|
// Unknown component
|
569
|
570
|
return false;
|
570
|
571
|
}
|
571
|
572
|
|
572
|
|
- final Path log = Paths.get(locator.getLogFile(descriptor));
|
|
573
|
+
|
573
|
574
|
|
574
|
575
|
if (!Files.exists(log)) {
|
575
|
576
|
// File doesn't exist
|