[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.2/kdenetwork/kopete/plugins/otr
From:       Michael Zanetti <michael_zanetti () gmx ! net>
Date:       2009-02-03 19:54:58
Message-ID: 1233690898.837650.6709.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 920797 by mzanetti:

backport revision 920794


 M  +8 -5      otrlchatinterface.cpp  
 M  +1 -1      otrlchatinterface.h  


--- branches/KDE/4.2/kdenetwork/kopete/plugins/otr/otrlchatinterface.cpp \
#920796:920797 @@ -657,11 +657,12 @@
 	new AuthenticationWizard( session->view()->mainWidget(), context, \
session, true );  }
 
-Fingerprint *OtrlChatInterface::findFingerprint( const QString &account ){
+Fingerprint *OtrlChatInterface::findFingerprint( Kopete::ChatSession \
*session ){  ConnContext *context;
 
 	for( context = userstate->context_root; context != NULL; context = \
                context->next ){
-		if( strcmp( context->username, account.toLocal8Bit() ) == 0 ){
+		if( ( session->members().first()->contactId().toLocal8Bit() == \
context->username ) && +		    \
(session->account()->accountId().toLocal8Bit() == context->accountname ) ){ \
return context->active_fingerprint ? context->active_fingerprint : NULL;  }
 	}
@@ -673,7 +674,8 @@
 	char hash[45];
 
 	for( context = userstate->context_root; context != NULL; context = \
                context->next ){
-		if( strcmp( context->username, \
session->members().first()->contactId().toLocal8Bit() ) == 0 ){ +		if( ( \
session->members().first()->contactId().toLocal8Bit() == context->username \
) && +		    (session->account()->accountId().toLocal8Bit() == \
context->accountname ) ){  otrl_privkey_hash_to_human( hash, \
context->active_fingerprint->fingerprint );  return hash;
 		}
@@ -682,8 +684,9 @@
 }
 
 bool OtrlChatInterface::isVerified( Kopete::ChatSession *session ){
-	Fingerprint *fingerprint = findFingerprint( \
session->members().first()->contactId() ); +	Fingerprint *fingerprint = \
findFingerprint( session );  
+	kDebug() << "fingerprint" << fingerprint;
 	if( fingerprint->trust && fingerprint->trust[0] != '\0' ){
 		return true;
 	} else {
@@ -715,7 +718,7 @@
 void OtrlChatInterface::setTrust( Kopete::ChatSession *session, bool trust \
){  Fingerprint *fingerprint;
 
-	fingerprint = findFingerprint( session->members().first()->contactId() );
+	fingerprint = findFingerprint( session );
 	if( fingerprint != 0 ){
 		if( trust ){
 			otrl_context_set_trust( fingerprint, "verified" );
--- branches/KDE/4.2/kdenetwork/kopete/plugins/otr/otrlchatinterface.h \
#920796:920797 @@ -74,7 +74,7 @@
 private:
 	OtrlChatInterface();
 	static OtrlChatInterface *mSelf;
-	Fingerprint *findFingerprint( const QString &username );
+	Fingerprint *findFingerprint( Kopete::ChatSession *session );
 
 signals:
 	void goneSecure(Kopete::ChatSession* session, int state);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic