On Thu, Nov 22, 2012 at 09:29:26AM -0500, David Goulet wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > Hi Ian, > > Yes I figured after sending the last email that it might be confusing > on what I'm trying to do :). Here goes. > > I'm currently working on the Irssi OTR module and I added a command to > forget a given fingerprint. So either the user does the command within > the chat window where for this case I have access to the OTR context > so no need to pass a fingerprint to the command or the user specifies > the human readable form of the fingerprint. (available fingerprints > can be listed using an other command.) > > With the later, the only thing I have is the string fingerprint (fp) > so, for now, the only solution I came up with is to iterate over all > OTR contexts of the user state for which I iterate over all fps and > try to match the fp using the otrl_privkey_hash_to_human() and, on > match, using otrl_context_find_fingerprint() for the fp object pointer. > > Once getting this pointer, I have to check to see if this fp is NOT in > an ENCRYPTED context before forgetting it. > > Here lies my problem, the fp->context always point to the m_context > which does not indicates me the right message state. For now, I've > fixed my problem by returning back the context of the fp previously > found with otrl_context_find_fingerprint() but I guess I should be > able to access all associated context(s) of the fp and make sure it's > safe to forget it? I guess, iterating on them starting with > m_context->next ? > > TBH, I'm just confused on how to proceed safely. > > Hope this is clearer :)
OK, I think I understand. What do you *want* to do if multiple children of a single master context are using the same fp, and some are in ENCRYPTED and some are not? - Ian _______________________________________________ OTR-dev mailing list [email protected] http://lists.cypherpunks.ca/mailman/listinfo/otr-dev
