From 25e400fbfabd5cb55a7db9e6730acaeae9deb93f Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 5 Jun 2007 01:26:39 +0000 Subject: make 'show inline' option apply to all libotr messages git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@197 4f64403b-2f21-0410-a795-97e2b3489a10 --- otr/dllmain.cpp | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'otr/dllmain.cpp') diff --git a/otr/dllmain.cpp b/otr/dllmain.cpp index 708c4ae..878688e 100644 --- a/otr/dllmain.cpp +++ b/otr/dllmain.cpp @@ -302,16 +302,13 @@ extern "C" void otr_gui_notify(void *opdata, OtrlNotifyLevel level, const char * * as a received message, or else by using the above notify() * callback. */ extern "C" int otr_gui_display_otr_message(void *opdata, const char *accountname, const char *protocol, const char *username, const char *msg) { - /* - * char buff[512]; - * mir_snprintf(buff, 512, Translate("%s(%s)"), protocol, username); - *ShowPopup(buff, msg, 0); - - return 0; - */ - //return 1; - - ShowMessageInline((HANDLE)opdata, Translate(msg)); + if(options.msg_inline) { + ShowMessageInline((HANDLE)opdata, Translate(msg)); + } else { + char buff[512]; + mir_snprintf(buff, 512, Translate("%s (%s)"), protocol, username); + ShowPopup(buff, msg, 0); + } return 0; } @@ -419,7 +416,7 @@ extern "C" void otr_gui_gone_secure(void *opdata, ConnContext *context) { } else { CloseHandle((HANDLE)_beginthreadex(0, 0, verify_fp_thread, context, 0, 0)); - mir_snprintf(buff, 1024, Translate("Beginning OTR encrypted session with '%s'"), context->username); + mir_snprintf(buff, 1024, Translate("Beginning OTR encrypted session with '%s' (NOT VERIFIED)"), context->username); //MessageBox(0, buff, Translate("OTR Information"), MB_OK); if(options.msg_inline) ShowMessageInline((HANDLE)opdata, buff); @@ -502,16 +499,8 @@ void CALLBACK ClearFinishedSessions(HWND, UINT, UINT, DWORD) { while(context) { if(context->msgstate == OTRL_MSGSTATE_FINISHED) { hContact = context->app_data; - - char *uproto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); - char *uname = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0); - if(uproto && uname) - otrl_message_disconnect(otr_user_state, &ops, hContact, MODULE, uproto, uname); - - //otrl_context_force_finished(context); - - SetEncryptionStatus(hContact, false); - + otrl_context_force_plaintext(context); + SetEncryptionStatus(hContact, false); } context = context->next; } -- cgit v1.2.3