HOWTO: Disable Timeout Alert in Lightning/WCAP Extension

/howto-disable-timeout-alert-in-lightningwcap-extension 2007-01-05T09:54:55+00:00

I've been using the Lightning Calendar extension, along with the WCAP extension ('cos we use SJSCS) to access my calendar at work for some time now.

I've configured the extension/Thunderbird to remember my calendar login details, added my calendars and all in all it works a treat. However, there is one thing that really started to annoy me. Everytime the session expires, I get this lovely little alert box:

WCAP Session Timeout Alert

This can be very annoying when in the middle of writing an email, and it's guaranteed to popup during the night. There also seems to be a slight bug in that when you click OK, an identical alert appears. Click OK here and everything is hunky dory until the next timeout, and we go through the process again.

Well, not any more. I've modified the relevant source code to automatically log me back in without showing the alert by changing the following section in ~/.thunderbird/<PROFILENAME>/*/extensions/<EXTDIR>/js/calWcapSession.js

Where <PROFILENAME> is the profile using the plugin and <EXTDIR> is the directory for the extension:

if (!this.m_sessionId || this.m_sessionId == timedOutSessionId) {
  try {
      this.m_sessionId = null;
      if (timedOutSessionId) {
          this.log( "prompting to reconnect.", "session timeout" );

          // Disabling annoying prompt
          // var prompt = getWindowWatcher().getNewPrompter(null);
          var prompt = '';

          var bundle = getWcapBundle();
          if (!prompt.confirm(
                      [this.uri.hostPort], 1 ) )) {
              this.log( "reconnect cancelled." );
              throw new Components.Exception(
                  "Login failed. Invalid session ID.",
                  calIWcapErrors.WCAP_LOGIN_FAILED );

Whilst this isn't the most elegant of solutions, it does the trick and works as I want it to. When I get the time, I'll sit down and write a better modification and feed back to the developers. Who knows, maybe the developers have already thought of this and will incorporate this when they incorporate a preferences dialog.

I've only tested this on Solaris with Thunderbird 2.0 alpha 1. Let me know if this works on other platforms/revs. The auto-updates are also likely to over-ride this change.

Copyright © 2005 - 2018 Colin Seymour All rights reserved. Privacy Policy.
Check out the feed if you do the RSS/Atom thing.