예제 #1
0
void CMailViewTpl::processHeaders( IWriteSink & f )
{
  PKludges Kludges = m_origMsg->GetKludges();

  for ( int i = 0; i < Kludges->Count(); i ++ )
  {
    FarString kludge = Kludges->At( i );

    m_origMsg->DecodeKludge( kludge.GetBuffer() ); kludge.ReleaseBuffer();

    int pos = 1;

    while ( ( pos = kludge.IndexOf( '\t', pos ) ) != -1 )
    {
      FarString ss = kludge.Left( pos );
      if (ss.Length() > 0 && ss[ss.Length() - 1] == ':')
      {
        pos ++;
        continue;
      }
      f.write( ss.c_str(), ss.Length() );
      f.write( "\r\n", 2 );
      kludge = kludge.Right( kludge.Length() - pos );
    }

    f.write( kludge.c_str(), kludge.Length() );

    if ( i < Kludges->Count() - 1 )
      f.write( "\r\n", 2 );
  }
}
예제 #2
0
FarString CMailViewPlugins::MakeKeyName( LPCSTR Root, LPCSTR FileName )
{
  FarString Key = ExtractRelativePath( Root, FileName );
  Key.Insert( 0, "Mailbox_" );
  Key.SetLength( Key.Length() - 4 );
  Key += "_Masks";

  int nIdx = Key.IndexOf( '\\' );
  while ( nIdx != -1 )
  {
    Key[ nIdx ] = '_';
    nIdx = Key.IndexOf( '\\' );
  }

  return Key;
}
예제 #3
0
void CMailViewTpl::processMessageId( int len, int fill, IWriteSink & f )
{
  FarString s = m_origMsg->GetId();
  if ( s.Length() > 2 && s[ 0 ] == '<' )
  {
    s = s.Mid( 1 );
    int pos = s.IndexOf( '>' );
    if ( pos != -1 )
      s = s.Left( pos );
  }
  writeFormatted( s, len, fill, f );
}
예제 #4
0
FarString CPerson::GetMailboxName() const
{
  if ( Addr.IsEmpty() && FTNAddr.Zone == 0 )
    return Name;

  FarString result;
  if ( !Addr.IsEmpty() )
    result += Addr;
  else
  {
    far_assert( FTNAddr.Zone != BAD_FTNADDR_FIELD );
    far_assert( FTNAddr.Net != BAD_FTNADDR_FIELD );
    far_assert( FTNAddr.Node != BAD_FTNADDR_FIELD );
    far_assert( FTNAddr.Point != BAD_FTNADDR_FIELD );

    // Dennis Trachuk <*****@*****.**>

    FarString tmp = Name;
    int pos;
    while ( (pos = tmp.IndexOf( '\x20' )) != -1 )
      tmp[ pos ] = '.';

    result += tmp;
    result += '@';
    if ( FTNAddr.Point )
      result += 'p' + IntToString( FTNAddr.Point ) + '.';
    if ( FTNAddr.Node )
      result += 'f' + IntToString( FTNAddr.Node );
    result += ".n" + IntToString( FTNAddr.Net );
    result += ".z" + IntToString( FTNAddr.Zone );
    result += ".fidonet.org";
  }

  if ( !Name.IsEmpty() )
    result = Name + " <" + result + '>';

  return result;
}