|
|
@ -380,7 +380,7 @@ int OtrlChatInterface::decryptMessage( TQString *msg, TQString accountId,
|
|
|
|
if( newMessage != NULL ){
|
|
|
|
if( newMessage != NULL ){
|
|
|
|
*msg = TQString::fromUtf8(newMessage);
|
|
|
|
*msg = TQString::fromUtf8(newMessage);
|
|
|
|
otrl_message_free( newMessage );
|
|
|
|
otrl_message_free( newMessage );
|
|
|
|
msg->tqreplace( TQString("\n"), TQString("<br>"), false );
|
|
|
|
msg->replace( TQString("\n"), TQString("<br>"), false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ignoremessage;
|
|
|
|
return ignoremessage;
|
|
|
@ -391,7 +391,7 @@ TQString OtrlChatInterface::encryptMessage( TQString msg, TQString accountId,
|
|
|
|
int err;
|
|
|
|
int err;
|
|
|
|
char * newMessage;
|
|
|
|
char * newMessage;
|
|
|
|
if( otrl_proto_message_type( msg ) == OTRL_MSGTYPE_NOTOTR ){
|
|
|
|
if( otrl_proto_message_type( msg ) == OTRL_MSGTYPE_NOTOTR ){
|
|
|
|
msg.tqreplace( TQString("<"), TQString("<"), false );
|
|
|
|
msg.replace( TQString("<"), TQString("<"), false );
|
|
|
|
err = otrl_message_sending( userstate, &ui_ops, chatSession, accountId.latin1(), protocol.latin1(), contactId.latin1(), msg.utf8(), NULL, &newMessage, NULL, NULL );
|
|
|
|
err = otrl_message_sending( userstate, &ui_ops, chatSession, accountId.latin1(), protocol.latin1(), contactId.latin1(), msg.utf8(), NULL, &newMessage, NULL, NULL );
|
|
|
|
|
|
|
|
|
|
|
|
if( err != 0 ){
|
|
|
|
if( err != 0 ){
|
|
|
@ -405,7 +405,7 @@ TQString OtrlChatInterface::encryptMessage( TQString msg, TQString accountId,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
OtrlMessageType type = otrl_proto_message_type( msg );
|
|
|
|
OtrlMessageType type = otrl_proto_message_type( msg );
|
|
|
|
if( type == OTRL_MSGTYPE_NOTOTR | type == OTRL_MSGTYPE_TAGGEDPLAINTEXT ){
|
|
|
|
if( type == OTRL_MSGTYPE_NOTOTR | type == OTRL_MSGTYPE_TAGGEDPLAINTEXT ){
|
|
|
|
msg.tqreplace( "<", "<", false );
|
|
|
|
msg.replace( "<", "<", false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -562,9 +562,9 @@ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){
|
|
|
|
if( keyfile.open( IO_ReadWrite ) ){
|
|
|
|
if( keyfile.open( IO_ReadWrite ) ){
|
|
|
|
kdDebug() << "file open" << endl;
|
|
|
|
kdDebug() << "file open" << endl;
|
|
|
|
while( keyfile.readLine( line, 200 ) != -1){
|
|
|
|
while( keyfile.readLine( line, 200 ) != -1){
|
|
|
|
if( line.tqfind( "protocol" ) != -1 ){
|
|
|
|
if( line.find( "protocol" ) != -1 ){
|
|
|
|
if( line.tqfind( account->accountLabel() ) != -1 ){
|
|
|
|
if( line.find( account->accountLabel() ) != -1 ){
|
|
|
|
line.tqreplace( account->accountLabel(), account->protocol()->displayName() );
|
|
|
|
line.replace( account->accountLabel(), account->protocol()->displayName() );
|
|
|
|
kdDebug() << "Successfully updated keyfile for account " << account->accountId() << endl;
|
|
|
|
kdDebug() << "Successfully updated keyfile for account " << account->accountId() << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -587,9 +587,9 @@ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){
|
|
|
|
if( fingerprintfile.open( IO_ReadWrite ) ){
|
|
|
|
if( fingerprintfile.open( IO_ReadWrite ) ){
|
|
|
|
kdDebug() << "file open" << endl;
|
|
|
|
kdDebug() << "file open" << endl;
|
|
|
|
while( fingerprintfile.readLine( line, 200 ) != -1){
|
|
|
|
while( fingerprintfile.readLine( line, 200 ) != -1){
|
|
|
|
int pos = line.tqfindRev( account->accountLabel() );
|
|
|
|
int pos = line.findRev( account->accountLabel() );
|
|
|
|
if( pos != -1 ){
|
|
|
|
if( pos != -1 ){
|
|
|
|
line.tqreplace( pos, account->accountLabel().length(), account->protocol()->displayName() );
|
|
|
|
line.replace( pos, account->accountLabel().length(), account->protocol()->displayName() );
|
|
|
|
kdDebug() << "Successfully updated fingerprint for account " << account->accountId() << endl;
|
|
|
|
kdDebug() << "Successfully updated fingerprint for account " << account->accountId() << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
file.append( line );
|
|
|
|
file.append( line );
|
|
|
|