<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Dec 22, 2006, at 4:39 PM, Ian Goldberg wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I didn't see a previous mail about this.<SPAN class="Apple-converted-space">  </SPAN>But this looks plausible.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I'll wait until after the holidays to apply and test it and stuff,</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">though.</FONT></P></BLOCKQUOTE><DIV>I'm not sure what happened to it.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here it is again:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">In libotr, contexts are often referred to be their account name and protocol, such as:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    format = </SPAN></FONT><FONT class="Apple-style-span" color="#7C1817" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">"?OTR Error: You sent encrypted "</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" color="#7C1817" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">"data to %s, who wasn't expecting it."</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">;</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    buf = malloc(strlen(format) + strlen(context->accountname)</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    - </SPAN></FONT><FONT class="Apple-style-span" color="#0024F8" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">1</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">   </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">    </SPAN></FONT><FONT class="Apple-style-span" color="#6B174E" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">if</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;"> (buf) {</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-tab-span" style="white-space:pre">      </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN><FONT class="Apple-style-span" face="Monaco" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">sprintf(buf, format, context->accountname);</SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">accountname and protocol are intended to be how to associate the context with a particular messaging account in the client.  However, to make that association, since a client can have multiple accounts with the same accountname and protocol, I use accountname to store a unique identifier for the account (a number).  Obviously, this results in error messages which are nonsense:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Lucida Grande" size="2"><SPAN class="Apple-style-span" style="font-size: 10px;">OTR Error: You sent encrypted data to 5, who wasn't expecting it.</SPAN></FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><and a dumb proposal here, which isn't as good as the patch></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">What is the function you're passing in there for Adium X?<SPAN class="Apple-converted-space">  </SPAN>Is gaim</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">likely to use the same function?<SPAN class="Apple-converted-space">  </SPAN>If so, it should probably go in the</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">UI-independent part of gaim-otr.</FONT></P> </BLOCKQUOTE></DIV>I'm not sure what gaim would use in terms of uniquely identifying an account; certainly gaim does support having multiple accounts with the same name on the same protocol.<BR><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Cheers,</DIV><DIV>Evan</DIV></BODY></HTML>