~ubuntu-branches/ubuntu/gutsy/firefox/gutsy

« back to all changes in this revision

Viewing changes to mailnews/imap/src/nsImapProtocol.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ian Jackson
  • Date: 2006-10-10 18:49:32 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20061010184932-da75izt7y0e59afq
Tags: 1.99+2.0rc2+dfsg-0ubuntu1
* New upstream version 2.0rc2.
* Fix/workaround for epiphany GtkSocket lifetype crash:
  apply patch id=241087 from Mozilla Bugzilla #241535 to fix LP #63814.
* Change application name to `Firefox', as requested by mdz.
  Files changed:
    - browser/locales/en-US/chrome/branding/brand.dtd
    - browser/locales/en-US/chrome/branding/brand.properties;
  New values:
    - brandShortName and brandFullName: `Bon Echo' => `Firefox'
    - vendorShortName: `Mozilla' => `Ubuntu'
* Make preferences dialogue fit again (bah!).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4372
4372
            AlertUserEventUsingId(IMAP_CONNECTION_REFUSED_ERROR);
4373
4373
            break;
4374
4374
        case NS_ERROR_NET_TIMEOUT:
4375
 
            AlertUserEventUsingId(IMAP_NET_TIMEOUT_ERROR);
4376
 
            break;
4377
4375
        case NS_ERROR_NET_RESET:
4378
4376
        case NS_BASE_STREAM_CLOSED:
4379
4377
        case NS_ERROR_NET_INTERRUPT:
4382
4380
            m_runningUrl->SetRerunningUrl(PR_TRUE);
4383
4381
            m_retryUrlOnError = PR_TRUE;
4384
4382
          }
 
4383
          else if (rv == NS_ERROR_NET_TIMEOUT)
 
4384
            AlertUserEventUsingId(IMAP_NET_TIMEOUT_ERROR);
4385
4385
          else
4386
4386
            AlertUserEventUsingId(TestFlag(IMAP_RECEIVED_GREETING) 
4387
4387
            ? IMAP_SERVER_DISCONNECTED : IMAP_SERVER_DROPPED_CONNECTION);
4388
 
            break;
 
4388
          break;
4389
4389
        default:
4390
4390
            break;
4391
4391
    }
5326
5326
    {
5327
5327
      imapMessageFlagsType flagsToSet = 0;
5328
5328
      PRUint32 msgFlags = 0;
 
5329
      PRTime date = 0;
5329
5330
      if (m_imapMessageSink)
5330
 
        m_imapMessageSink->GetCurMoveCopyMessageFlags(m_runningUrl, &msgFlags);
 
5331
        m_imapMessageSink->GetCurMoveCopyMessageInfo(m_runningUrl, &date, &msgFlags);
5331
5332
      
5332
5333
      if (msgFlags & MSG_FLAG_READ)
5333
5334
        flagsToSet |= kImapMsgSeenFlag;
5336
5337
      // convert msg flag label (0xE000000) to imap flag label (0x0E00)
5337
5338
      if (msgFlags & MSG_FLAG_LABELS)
5338
5339
        flagsToSet |= (msgFlags & MSG_FLAG_LABELS) >> 16;
5339
 
      UploadMessageFromFile(fileSpec, mailboxName, flagsToSet);
 
5340
      UploadMessageFromFile(fileSpec, mailboxName, date, flagsToSet);
5340
5341
      PR_Free( mailboxName );
5341
5342
    }
5342
5343
    else
5348
5349
 
5349
5350
void nsImapProtocol::UploadMessageFromFile (nsIFileSpec* fileSpec,
5350
5351
                                            const char* mailboxName,
 
5352
                                            PRTime date,
5351
5353
                                            imapMessageFlagsType flags)
5352
5354
{
5353
5355
  if (!fileSpec || !mailboxName) return;
5381
5383
      command.Append(flagString);
5382
5384
      command.Append(")");
5383
5385
    }
 
5386
    
 
5387
    // date should never be 0, but just in case...
 
5388
    if (date)
 
5389
    {
 
5390
      /* Use PR_FormatTimeUSEnglish() to format the date in US English format,
 
5391
        then figure out what our local GMT offset is, and append it (since
 
5392
        PR_FormatTimeUSEnglish() can't do that.) Generate four digit years as
 
5393
        per RFC 1123 (superceding RFC 822.)
 
5394
        */
 
5395
      char szDateTime[64];
 
5396
      char dateStr[100];
 
5397
      PRExplodedTime exploded;
 
5398
      PR_ExplodeTime(date, PR_LocalTimeParameters, &exploded);
 
5399
      PR_FormatTimeUSEnglish(szDateTime, sizeof(szDateTime), "%d-%b-%Y %H:%M:%S", &exploded);
 
5400
      PRExplodedTime now;
 
5401
      PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &now);
 
5402
      int gmtoffset = (now.tm_params.tp_gmt_offset + now.tm_params.tp_dst_offset) / 60;
 
5403
      PR_snprintf(dateStr, sizeof(dateStr),
 
5404
                            " \"%s %c%02d%02d\"",
 
5405
                            szDateTime,
 
5406
                            (gmtoffset >= 0 ? '+' : '-'),
 
5407
                            ((gmtoffset >= 0 ? gmtoffset : -gmtoffset) / 60),
 
5408
                            ((gmtoffset >= 0 ? gmtoffset : -gmtoffset) % 60));
 
5409
      
 
5410
      command.Append(dateStr);
 
5411
    }
5384
5412
    command.Append(" {");
5385
5413
    
5386
5414
    dataBuffer = (char*) PR_CALLOC(COPY_BUFFER_SIZE+1);