[OTR-dev] Re: Requirements for libotr4
Ian Goldberg
ian at cypherpunks.ca
Fri Jun 20 09:55:48 EDT 2008
On Fri, Jun 20, 2008 at 03:43:57PM +0200, Kjell Braden wrote:
> My idea was this:
>
> The lib calls a callback like:
>
> humanize_string(&human_message, OTRL_MSG_EVENT_UNENCRYPTED, message)
> and send the resulting human_message to display_otr_message.
But the application may not want the result to just be a string passed
to display_otr_message. It might want to change some chrome in the UI,
pop up a message box, or do something else entirely.
Your suggestion also has the effect of forcing there to be a second
callback to free the memory allocated by the first callback. (See the
account_name and account_name_free callbacks, for example; hey--come to
think of it, those will be able to go away with the new scheme. Nice!)
> Same for the Query Message: otrl_proto_default_query_msg (or whoever)
> goes like:
> humanize_string(&human_message, OTRL_MSG_QUERY)
> and returns the resulting human_message.
I suppose this could be done the above way as well: then it would be up
to the callback to actually transmit the Query Message after it
constructs it. It would be passed the "?OTR?v2?" prefix. I like that,
actually.
- Ian
More information about the OTR-dev
mailing list