--- a/Frameworks/Adium Framework/Source/AIContentControllerProtocol.h Tue May 28 00:52:55 2013 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentControllerProtocol.h Tue May 28 01:40:11 2013 +0200
@@ -125,8 +125,9 @@
- (NSAttributedString *)decodedIncomingMessage:(NSString *)inString
- fromContact:(AIListContact *)inListContact
- onAccount:(AIAccount *)inAccount;
+ fromContact:(AIListContact *)inListContact + onAccount:(AIAccount *)inAccount + tryDecrypt:(BOOL)decrypt; - (NSString *)decryptedIncomingMessage:(NSString *)inString
fromContact:(AIListContact *)inListContact
onAccount:(AIAccount *)inAccount;
--- a/Plugins/Bonjour/AWBonjourAccount.m Tue May 28 00:52:55 2013 +0200
+++ b/Plugins/Bonjour/AWBonjourAccount.m Tue May 28 01:40:11 2013 +0200
@@ -241,7 +241,8 @@
attributedMessage = [adium.contentController decodedIncomingMessage:html
attributedMessage = [[[NSAttributedString alloc] initWithString:
[adium.contentController decryptedIncomingMessage:message
--- a/Plugins/Purple Service/CBPurpleAccount.m Tue May 28 00:52:55 2013 +0200
+++ b/Plugins/Purple Service/CBPurpleAccount.m Tue May 28 01:40:11 2013 +0200
@@ -1177,13 +1177,14 @@
listContact = chat.listObject;
- attributedMessage = [adium.contentController decodedIncomingMessage:[messageDict objectForKey:@"Message"]
- fromContact:listContact
//Clear the typing flag of the chat since a message was just received
[self setTypingFlagOfChat:chat to:nil];
+ attributedMessage = [adium.contentController decodedIncomingMessage:[messageDict objectForKey:@"Message"] + fromContact:listContact + tryDecrypt:(flags & PURPLE_MESSAGE_SEND) == 0]; [self _receivedMessage:attributedMessage
fromListContact:listContact
--- a/Source/AIContentController.m Tue May 28 00:52:55 2013 +0200
+++ b/Source/AIContentController.m Tue May 28 01:40:11 2013 +0200
@@ -789,11 +789,11 @@
* @brief Given an incoming message, decrypt it if necessary then convert it to an NSAttributedString, processing HTML if possible
-- (NSAttributedString *)decodedIncomingMessage:(NSString *)inString fromContact:(AIListContact *)inListContact onAccount:(AIAccount *)inAccount
+- (NSAttributedString *)decodedIncomingMessage:(NSString *)inString fromContact:(AIListContact *)inListContact onAccount:(AIAccount *)inAccount tryDecrypt:(BOOL)decrypt - return [AIHTMLDecoder decodeHTML:[self decryptedIncomingMessage:inString
- fromContact:inListContact
+ return [AIHTMLDecoder decodeHTML:decrypt ? [self decryptedIncomingMessage:inString + fromContact:inListContact + onAccount:inAccount] : inString]; --- a/Source/AdiumOTREncryption.m Tue May 28 00:52:55 2013 +0200
+++ b/Source/AdiumOTREncryption.m Tue May 28 01:40:11 2013 +0200
@@ -335,7 +335,7 @@
username = [chat.listObject.UID UTF8String];
context = otrl_context_find(otrg_plugin_userstate,
- username, accountname, proto, OTRL_INSTAG_RECENT, 0, NULL,
+ username, accountname, proto, OTRL_INSTAG_RECENT, 1, NULL, AILogWithSignature(@"%@ -> %p", chat, context);
@@ -725,12 +725,16 @@
case OTRL_SMPEVENT_ASK_FOR_ANSWER: {
- AIOTRSMPSecretAnswerWindowController *questionController = [[AIOTRSMPSecretAnswerWindowController alloc] initWithQuestion:[NSString stringWithUTF8String:question] from:listContact completionHandler:^(NSString *answer,NSString *_question){
+ AIOTRSMPSecretAnswerWindowController *questionController = [[AIOTRSMPSecretAnswerWindowController alloc] + initWithQuestion:[NSString stringWithUTF8String:question] + completionHandler:^(NSString *answer,NSString *_question){ otrl_message_abort_smp(otrg_get_userstate(), &ui_ops, opdata, context);
otrl_message_respond_smp(otrg_get_userstate(), &ui_ops, opdata, context, (const unsigned char*)[answer UTF8String], answer.length);
[questionController showWindow:nil];
[questionController.window orderFront:nil];
@@ -738,9 +742,12 @@
case OTRL_SMPEVENT_ASK_FOR_SECRET: {
- AIOTRSMPSharedSecretWindowController *questionController = [[AIOTRSMPSharedSecretWindowController alloc] initFrom:listContact completionHandler:^(NSString *answer){
+ AIOTRSMPSharedSecretWindowController *questionController = [[AIOTRSMPSharedSecretWindowController alloc] + completionHandler:^(NSString *answer){ otrl_message_respond_smp(otrg_get_userstate(), &ui_ops, opdata, context, (const unsigned char*)[answer UTF8String], answer.length);
[questionController showWindow:nil];
[questionController.window orderFront:nil];
@@ -749,7 +756,10 @@
case OTRL_SMPEVENT_ERROR:
/* case OTRL_SMPEVENT_FAILURE: */ // I'm not actually sure what this event indicates, but it's not fatal failure of SMP.
case OTRL_SMPEVENT_ABORT: {
- NSString *localizedMessage = [NSString stringWithFormat:AILocalizedStringFromTableInBundle(@"Failed to verify %@'s identity.", nil, [NSBundle bundleForClass:[AdiumOTREncryption class]], nil), listContact.UID];
+ NSString *localizedMessage = [NSString stringWithFormat:AILocalizedStringFromTableInBundle(@"Failed to verify %@'s identity.", + [NSBundle bundleForClass:[AdiumOTREncryption class]], nil), AIChat *chat = chatForContext(context);
if (!chat) chat = [adium.chatController chatWithContact:listContact];
@@ -759,7 +769,10 @@
case OTRL_SMPEVENT_SUCCESS: {
- NSString *localizedMessage = [NSString stringWithFormat:AILocalizedStringFromTableInBundle(@"Successfully verified %@'s identity.", nil, [NSBundle bundleForClass:[AdiumOTREncryption class]], nil), listContact.UID];
+ NSString *localizedMessage = [NSString stringWithFormat:AILocalizedStringFromTableInBundle(@"Successfully verified %@'s identity.", + [NSBundle bundleForClass:[AdiumOTREncryption class]], nil), AIChat *chat = chatForContext(context);
if (!chat) chat = [adium.chatController chatWithContact:listContact];
@@ -902,16 +915,18 @@
ConnContext *context = contextForChat(inChat);
- AIOTRSMPSecretAnswerWindowController *windowController = [[AIOTRSMPSecretAnswerWindowController alloc] initWithQuestion:@""
- completionHandler:^(NSString *answer, NSString *question) {
+ AIOTRSMPSecretAnswerWindowController *windowController = [[AIOTRSMPSecretAnswerWindowController alloc] + completionHandler:^(NSString *answer, NSString *question) { + const char *answerStr = [answer UTF8String]; otrl_message_initiate_smp_q(otrg_get_userstate(),
(const char *)[question UTF8String],
- (const unsigned char *)[answer UTF8String],
+ (const unsigned char*)answerStr,
[windowController showWindow:nil];
[windowController.window orderFront:nil];
@@ -921,15 +936,17 @@
ConnContext *context = contextForChat(inChat);
- AIOTRSMPSharedSecretWindowController *windowController = [[AIOTRSMPSharedSecretWindowController alloc] initFrom:inChat.listObject
- completionHandler:^(NSString *answer) {
+ AIOTRSMPSharedSecretWindowController *windowController = [[AIOTRSMPSharedSecretWindowController alloc] + initFrom:inChat.listObject + completionHandler:^(NSString *answer) { + const char *answerStr = [answer UTF8String]; otrl_message_initiate_smp(otrg_get_userstate(),
- (const unsigned char *)[answer UTF8String],
+ (const unsigned char*)answerStr,
[windowController showWindow:nil];
[windowController.window orderFront:nil];