[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdenetwork/kopete/protocols/groupwise
From: Will Stephenson <wstephenson () kde ! org>
Date: 2008-09-26 21:24:18
Message-ID: 1222464258.734099.28799.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 865154 by wstephens:
Fix accidental insertion of null contacts using operator[] and wrong contactids. \
Fixes bnc#404147
M +16 -5 gwaccount.cpp
M +1 -5 gwcontact.cpp
M +1 -1 gwmessagemanager.cpp
M +0 -1 libgroupwise/client.cpp
M +1 -1 libgroupwise/tasks/getdetailstask.cpp
M +12 -1 libgroupwise/userdetailsmanager.cpp
--- trunk/KDE/kdenetwork/kopete/protocols/groupwise/gwaccount.cpp #865153:865154
@@ -220,7 +220,7 @@
return candidate;
}
// we might have just added the contact with a user ID, try the first section of \
the dotted dn
- return static_cast< GroupWiseContact * >( contacts()[ protocol()->dnToDotted( dn \
).section( '.', 0, 0 ) ] ); + return static_cast< GroupWiseContact * >( \
contacts().value( protocol()->dnToDotted( dn ).section( '.', 0, 0 ) )); }
void GroupWiseAccount::setAway( bool away, const QString & reason )
@@ -1074,10 +1074,20 @@
GroupWiseContact * GroupWiseAccount::createTemporaryContact( const QString & dn )
{
ContactDetails details = client()->userDetailsManager()->details( dn );
- GroupWiseContact * c = static_cast<GroupWiseContact *>( contacts()[ \
details.dn.toLower() ] );
- if ( !c && details.dn != accountId() )
+ GroupWiseContact * c = static_cast<GroupWiseContact *>( \
contacts().value(details.dn.toLower() )); + if ( !c && ( details.dn != accountId() ) \
) {
kDebug() << "Got a temporary contact DN: " << details.dn;
+ kDebug()
+ << " Auth attribute: " << details.authAttribute
+ << " , Away message: " << details.awayMessage
+ << " , CN" << details.cn
+ << " , DN" << details.dn
+ << " , fullName" << details.fullName
+ << " , surname" << details.surname
+ << " , givenname" << details.givenName
+ << " , status" << details.status
+ << endl;
// the client is telling us about a temporary contact we need to know about so add \
them Kopete::MetaContact *metaContact = new Kopete::MetaContact ();
metaContact->setTemporary (true);
@@ -1095,7 +1105,9 @@
m_client->requestStatus( details.dn );
}
else
+ {
kDebug() << "Notified of existing temporary contact DN: " << details.dn;
+ }
return c;
}
@@ -1247,7 +1259,7 @@
else
{
// delete the contact created optimistically using the supplied userid;
- Kopete::Contact * c = contacts()[ protocol()->dnToDotted( cct->userId() ) ];
+ Kopete::Contact * c = contacts().value(protocol()->dnToDotted( cct->userId()) );
if ( c )
{
// if the contact creation failed because it already exists on the server, don't \
delete it @@ -1259,7 +1271,6 @@
delete c;
}
}
-
KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget (), \
KMessageBox::Error,
i18n ("The contact %1 could not be added to the contact list, with error \
message: %2", cct->userId(), cct->statusString() ),
--- trunk/KDE/kdenetwork/kopete/protocols/groupwise/gwcontact.cpp #865153:865154
@@ -67,11 +67,6 @@
GroupWiseContact::~GroupWiseContact()
{
- // This is necessary because otherwise the userDetailsManager
- // would not fetch details for this contact if they contact you
- // again from off-contact-list.
- if ( metaContact()->isTemporary() )
- account()->client()->userDetailsManager()->removeContact( contactId() );
}
QString GroupWiseContact::dn() const
@@ -203,6 +198,7 @@
void GroupWiseContact::deleteContact()
{
account()->deleteContact( this );
+ Kopete::Contact::deleteContact();
}
void GroupWiseContact::sync( unsigned int)
--- trunk/KDE/kdenetwork/kopete/protocols/groupwise/gwmessagemanager.cpp \
#865153:865154 @@ -360,7 +360,7 @@
void GroupWiseChatSession::inviteContact( const QString &contactId )
{
- Kopete::Contact * contact = account()->contacts()[ contactId ];
+ Kopete::Contact * contact = account()->contacts().value(contactId);
if ( contact )
slotInviteContact( contact );
}
--- trunk/KDE/kdenetwork/kopete/protocols/groupwise/libgroupwise/client.cpp \
#865153:865154 @@ -98,7 +98,6 @@
{
delete d->root;
delete d->requestFactory;
- delete d->userDetailsMgr;
delete d;
}
--- trunk/KDE/kdenetwork/kopete/protocols/groupwise/libgroupwise/tasks/getdetailstask.cpp \
#865153:865154 @@ -91,7 +91,7 @@
cd.surname = sf->value().toString();
if ( ( sf = fields.findSingleField ( Field::KOPETE_NM_USER_DETAILS_ARCHIVE_FLAG ) ) \
) cd.archive = ( sf->value().toInt() == 1 );
-// if ( ( sf = fields.findSingleField ( Field::KOPETE_NM_USER_DETAILS_FULL_NAME ) ) \
) + if ( ( sf = fields.findSingleField ( Field::KOPETE_NM_USER_DETAILS_FULL_NAME ) ) \
) cd.fullName = sf->value().toString();
if ( ( sf = fields.findSingleField ( Field::NM_A_SZ_STATUS ) ) )
cd.status = sf->value().toInt();
--- trunk/KDE/kdenetwork/kopete/protocols/groupwise/libgroupwise/userdetailsmanager.cpp \
#865153:865154 @@ -47,6 +47,7 @@
ContactDetails UserDetailsManager::details( const QString & dn )
{
+// qDebug() << "UserDetailsManager::details() requested for " << dn.toLatin1();
return m_detailsMap[ dn ];
}
@@ -57,7 +58,7 @@
void UserDetailsManager::addDetails( const ContactDetails & details )
{
- //qDebug( "UserDetailsManager::addContact, got %s, we now know: ", \
details.dn.ascii() ); +// qDebug() << "UserDetailsManager::addDetails, got " << \
details.dn; m_detailsMap.insert( details.dn, details );
/* QStringList keys = m_detailsMap.keys();
dump( keys );
@@ -120,6 +121,16 @@
m_pendingDNs.removeAll( details.dn );
/*client()->userDetailsManager()->*/
addDetails( details );
+ kDebug()
+ << " Auth attribute: " << details.authAttribute
+ << " , Away message: " << details.awayMessage
+ << " , CN" << details.cn
+ << " , DN" << details.dn
+ << " , fullName" << details.fullName
+ << " , surname" << details.surname
+ << " , givenname" << details.givenName
+ << " , status" << details.status
+ << endl;
//emit temporaryContact( details );
emit gotContactDetails( details );
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic