Changeset 367:73c2fb9fc502 in SMSSender


Ignore:
Timestamp:
Apr 9, 2014 3:56:34 PM (6 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
separation-frontend-backend
Message:
  • Renewes CA for Google contacts import.
  • Fixes utf8 problems in Google contacts import.
  • Uses fullName instead of givenName in Google contacts import.
  • Fixes bug where phone numbers were not imported since their entry did not match our regexp due to additional properties.
Location:
frontend
Files:
1 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • frontend/business/contactimporter/googlecontactimporter_base.cpp

    r364 r367  
    2828    : m_authData(authData)
    2929{
    30     m_httpHelper.addTrustedCA(":/certs/VerisignClass3PublicPrimaryCertificationAuthority.crt");
     30    m_httpHelper.addTrustedCA(":/certs/Equifax_Secure_Certificate_Authority.crt");
    3131}
    3232
     
    3636    m_httpHelper.defaultHeaders().insert("GData-Version", "3.0");
    3737
    38     QString nextUrl = "http://www.google.com/m8/feeds/contacts/default/thin?max-results=10000";
     38    QString nextUrl = "http://www.google.com/m8/feeds/contacts/default/full?max-results=10000";
    3939    do {
    40         QString contactsFeed = m_httpHelper.syncGet(nextUrl)->readAll();
     40        QString contactsFeed =
     41                QString::fromUtf8(m_httpHelper.syncGet(nextUrl)->readAll());
    4142        contactsFeed = SNetworkHelper::urldecodeString(contactsFeed);
    4243        parseContactsFeed(contactsFeed, contacts);
     
    8384            rx2.setMinimal(true);
    8485
    85             rx2.setPattern("<gd:name>.*<gd:givenName>(.*)</gd:givenName>.*</gd:name>");
     86            rx2.setPattern("<gd:name>.*<gd:fullName>(.*)</gd:fullName>.*</gd:name>");
    8687            if (rx2.indexIn(entry) == -1) continue;
    8788            QString name = rx2.cap(1);
    8889
    89             rx2.setPattern("<gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'>(.*)</gd:phoneNumber>");
     90            rx2.setPattern("<gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'.*>(.*)</gd:phoneNumber>");
    9091            if (rx2.indexIn(entry) == -1) continue;
    9192            SNumber number(rx2.cap(1));
  • frontend/lib/frontend.qrc

    r356 r367  
    77    </qresource>
    88    <qresource prefix="/certs">
    9         <file>VerisignClass3PublicPrimaryCertificationAuthority.crt</file>
     9        <file>Equifax_Secure_Certificate_Authority.crt</file>
    1010    </qresource>
    1111</RCC>
Note: See TracChangeset for help on using the changeset viewer.