Comments (4)
OTRCodec.m is where all of the real communication with the OTR library happens. I actually don't know how to explicitly request a disconnect at the moment, but I'm sure if you looked at the Adium OTR plugin source or pidgin-otr plugin you'd be able to figure out what is going on.
from chatsecure-ios.
in libotr/message.c, I see this function
/* Put a connection into the PLAINTEXT state, first sending the other side a notice that we're doing so if we're currently ENCRYPTED, and we think he's logged in. */ void otrl_message_disconnect(OtrlUserState us, const OtrlMessageAppOps *ops, void *opdata, const char *accountname, const char *protocol, const char *username) { ConnContext *context = otrl_context_find(us, username, accountname, protocol, 0, NULL, NULL, NULL); if (!context) return; if (context->msgstate == OTRL_MSGSTATE_ENCRYPTED && context->their_keyid > 0 && ops->is_logged_in && ops->is_logged_in(opdata, accountname, protocol, username) == 1) { if (ops->inject_message) { char *encmsg = NULL; gcry_error_t err; OtrlTLV *tlv = otrl_tlv_new(OTRL_TLV_DISCONNECTED, 0, NULL); err = otrl_proto_create_data(&encmsg, context, "", tlv, OTRL_MSGFLAGS_IGNORE_UNREADABLE); if (!err) { ops->inject_message(opdata, accountname, protocol, username, encmsg); } free(encmsg); } } otrl_context_force_plaintext(context); if (ops->update_context_list) { ops->update_context_list(opdata); } }
and I see in Adium OTR plugin source, it also called that function to disconnect.
So I try to add this code below in your OTR iOS :
+(void) disconnectSession:(NSString*)sender recipient:(NSString*)recipient protocol:(NSString*)protocol { OTRProtocolManager *protocolManager = [OTRProtocolManager sharedInstance]; OtrlUserState userstate = protocolManager.encryptionManager.userState; if(!userstate) NSLog(@"userstate is nil!"); otrl_message_disconnect(userstate, &ui_ops, NULL, [sender UTF8String], [protocol UTF8String], [recipient UTF8String]); }
but it does nothing. It suppose to call the inject_message function. Can you help me here Chris ?
from chatsecure-ios.
Hmm if it isn't forcing plaintext by injecting a message then perhaps err != nil?
from chatsecure-ios.
Were you able to figure out the problem? I'm going to close this issue for now, feel free to reopen it if you have any other questions.
from chatsecure-ios.
Related Issues (20)
- Latest version is 5.0.2 in Releases section
- Website is not up-to-date
- Why public/open access level specified with swift classes?
- Push notification problem with pubsub.chatsecure.cat - prosody 0.11.9 (SASL EXTERNAL failed) HOT 18
- Push notifications not working anymore with Let'sEncrypt server certificate after Sept 30 HOT 5
- Some unstability issues on iOS 15.1 HOT 3
- regarding creating new account in chat secure HOT 1
- Secure HOT 2
- Broke OTR session on folding ChatSecure Messenger HOT 1
- trying to understand why push notifications is failing HOT 5
- README doesn't explain that this isn't maintained any more
- Hope to better protect privacy HOT 1
- Pending Approval on recipient chat HOT 1
- Secure hijacked iphone se
- Push notification / ejabberd 23.04 to chatsecure 5.0.4 (171) HOT 2
- How can we enable logs for yap db queries
- unable to open configuration settings file HOT 1
- There is no XCFramework found HOT 2
- Omemo Message Delivery failed HOT 1
- iOS OTR encryption failure
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatsecure-ios.