#include "stdafx.h" static HGENMENU hStopItem, hStartItem; //////////////////////////////// ///////// Menu Services //////// /////////////////////////////// int StartOTR(MCONTACT hContact) { const char *proto = GetContactProto(hContact); if (!proto) return 1; // error char *uname = contact_get_id(hContact); if (!uname) return 1; // error DWORD pol = db_get_dw(hContact, MODULENAME, "Policy", CONTACT_DEFAULT_POLICY); if(pol == CONTACT_DEFAULT_POLICY) pol = options.default_policy; lib_cs_lock(); #ifndef MIROTR_PROTO_HELLO_MSG char *msg = otrl_proto_default_query_msg(MODULENAME, pol); otr_gui_inject_message((void*)hContact, proto, proto, uname, msg ? msg : MIROTR_PROTO_HELLO); free(msg); #else wchar_t* nick=ProtoGetNickname(proto); if(nick){ wchar_t msg[1024]; wchar_t* msgend = msg+_countof(msg)-1; wchar_t* msgoff = msg; for(const char* c=MIROTR_PROTO_HELLO; *c; *msgoff++=*c++); *msgoff++ = '\n'; for(const wchar_t* c=nick; *c && msgoff