diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-06-01 08:41:50 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2012-06-01 08:41:50 +0000 |
commit | 97f00d4a432a0688f1446c5bf10d92e5a60c0cf8 (patch) | |
tree | 942362de0c3646e2e3f92a3c0240486d1888b507 | |
parent | 4b00ebbb7e12aa763e9528c6ea145ba17c937469 (diff) | |
download | jitsi-97f00d4a432a0688f1446c5bf10d92e5a60c0cf8.zip jitsi-97f00d4a432a0688f1446c5bf10d92e5a60c0cf8.tar.gz jitsi-97f00d4a432a0688f1446c5bf10d92e5a60c0cf8.tar.bz2 |
Integrates Jitsi presence, IM and VoIP with MS Outlook.
173 files changed, 4928 insertions, 147 deletions
@@ -935,7 +935,7 @@ bundle-provdisc,bundle-provdisc-dhcp,bundle-provdisc-mdns, bundle-provisioning,bundle-addrbook,bundle-plugin-ldap, bundle-plugin-contactsourceconfig,bundle-plugin-certconfig, - bundle-globalshortcut"/> + bundle-globalshortcut,bundle-plugin-msofficecomm"/> <!--BUNDLE-SC-LAUNCHER--> <target name="bundle-sc-launcher"> @@ -2717,7 +2717,6 @@ javax.swing.event, javax.swing.border"/> </jar> </target> - <target name="bundle-plugin-certconfig"> <jar compress="false" destfile="${bundles.dest}/plugin-certconfig.jar" manifest="${src}/net/java/sip/communicator/plugin/certconfig/certconfig.manifest.mf"> @@ -2735,4 +2734,12 @@ javax.swing.event, javax.swing.border"/> prefix="net/java/sip/communicator/service/globalshortcut"/> </jar> </target> + + <target name="bundle-plugin-msofficecomm"> + <jar compress="false" destfile="${bundles.dest}/plugin-msofficecomm.jar" + manifest="${src}/net/java/sip/communicator/plugin/msofficecomm/msofficecomm.manifest.mf"> + <zipfileset dir="${dest}/net/java/sip/communicator/plugin/msofficecomm" + prefix="net/java/sip/communicator/plugin/msofficecomm" /> + </jar> + </target> </project> diff --git a/lib/felix.client.run.properties b/lib/felix.client.run.properties index 7200b24..8f63d7b 100644 --- a/lib/felix.client.run.properties +++ b/lib/felix.client.run.properties @@ -165,11 +165,11 @@ felix.auto.start.67= \ reference:file:sc-bundles/plugin-nimbuzzavatars.jar \ reference:file:sc-bundles/chatconfig.jar \ reference:file:sc-bundles/addrbook.jar \ + reference:file:sc-bundles/plugin-msofficecomm.jar \ reference:file:sc-bundles/plugin-ldap.jar \ reference:file:sc-bundles/plugin-contactsourceconfig.jar \ reference:file:sc-bundles/plugin-certconfig.jar - # Level 68 is for profiler4j. Either don't use it or change the build.xml file # accordingly. diff --git a/lib/native/windows-64/jmsofficecomm.dll b/lib/native/windows-64/jmsofficecomm.dll Binary files differnew file mode 100755 index 0000000..bffbd08 --- /dev/null +++ b/lib/native/windows-64/jmsofficecomm.dll diff --git a/lib/native/windows/jmsofficecomm.dll b/lib/native/windows/jmsofficecomm.dll Binary files differnew file mode 100755 index 0000000..e5e3c1c --- /dev/null +++ b/lib/native/windows/jmsofficecomm.dll diff --git a/resources/install/windows/SCRegistrySpec.wxi b/resources/install/windows/SCRegistrySpec.wxi index 99598ab..ae24a7c 100644 --- a/resources/install/windows/SCRegistrySpec.wxi +++ b/resources/install/windows/SCRegistrySpec.wxi @@ -67,6 +67,33 @@ </RegistryKey>
</Component>
+ <Component
+ Id="Component_MsOfficeCommRegistryEntries_X86"
+ Directory="TARGETDIR"
+ Guid="9a590be3-d2c6-48e6-8d6a-a8ca71ad0aac"
+ Win64="no">
+ <Condition><![CDATA[CREATE_MSOFFICECOMM_REGISTRY_ENTRIES = 1]]></Condition>
+ <RegistryKey Action="createAndRemoveOnUninstall"
+ Key="SOFTWARE\Microsoft\Office\Outlook\Call Integration"
+ Root="HKLM">
+ <RegistryValue Name="IMApplication" Type="string" Value="run.exe" />
+ </RegistryKey>
+ </Component>
+<?if $(var.Platform) = x64 ?>
+ <Component
+ Id="Component_MsOfficeCommRegistryEntries_X64"
+ Directory="TARGETDIR"
+ Guid="ce3c9a0f-1876-470e-823c-a29d7b7fcb26"
+ Win64="yes">
+ <Condition><![CDATA[CREATE_MSOFFICECOMM_REGISTRY_ENTRIES = 1]]></Condition>
+ <RegistryKey Action="createAndRemoveOnUninstall"
+ Key="SOFTWARE\Microsoft\Office\Outlook\Call Integration"
+ Root="HKLM">
+ <RegistryValue Name="IMApplication" Type="string" Value="run.exe" />
+ </RegistryKey>
+ </Component>
+<?endif ?>
+
</ComponentGroup>
</Fragment>
</Include>
diff --git a/resources/install/windows/installer-windows.wxs b/resources/install/windows/installer-windows.wxs index 99b0ab2..0bf0ea5 100644 --- a/resources/install/windows/installer-windows.wxs +++ b/resources/install/windows/installer-windows.wxs @@ -473,6 +473,7 @@ sense to associate SIP Communicator with the FEED protocol.
-->
<Property Id="CREATE_FEED_REGISTRY_ENTRIES" Value="0" />
+<Property Id="CREATE_MSOFFICECOMM_REGISTRY_ENTRIES" Value="1" />
<Property Id="CREATE_SIP_REGISTRY_ENTRIES" Value="1" />
<Property Id="CREATE_XMPP_REGISTRY_ENTRIES" Value="1" />
<Property Id="IS_AUTOUPDATE" Value="0" Hidden="yes" />
diff --git a/src/native/windows/msofficecomm/ClassFactory.cxx b/src/native/windows/msofficecomm/ClassFactory.cxx new file mode 100644 index 0000000..98aa171 --- /dev/null +++ b/src/native/windows/msofficecomm/ClassFactory.cxx @@ -0,0 +1,7 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "ClassFactory.h" diff --git a/src/native/windows/msofficecomm/ClassFactory.h b/src/native/windows/msofficecomm/ClassFactory.h new file mode 100644 index 0000000..abe56cd --- /dev/null +++ b/src/native/windows/msofficecomm/ClassFactory.h @@ -0,0 +1,52 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_CLASSFACTORY_H_ +#define _JMSOFFICECOMM_CLASSFACTORY_H_ + +#include "OutOfProcessServer.h" +#include "UnknownImpl.h" + +/** + * Represents a base implementation of the <tt>IClassFactory</tt> interface. + * + * @author Lyubomir Marinov + */ +class ClassFactory + : public UnknownImpl<IClassFactory, IID_IClassFactory> +{ +public: + // IClassFactory + STDMETHOD(LockServer)(BOOL lock) + { + lock ? OutOfProcessServer::addRef() : OutOfProcessServer::release(); + return S_OK; + }; + + HRESULT registerClassObject() + { + return + ::CoRegisterClassObject( + _clsid, + this, + CLSCTX_LOCAL_SERVER, + REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED, + &_registration); + }; + + HRESULT revokeClassObject() { return ::CoRevokeClassObject(_registration); }; + +protected: + ClassFactory(REFCLSID clsid) : _clsid(clsid), _registration(0) {}; + virtual ~ClassFactory() {}; + + const CLSID _clsid; + +private: + DWORD _registration; +}; + +#endif /* #ifndef _JMSOFFICECOMM_CLASSFACTORY_H_ */ diff --git a/src/native/windows/msofficecomm/ConnectionPoint.h b/src/native/windows/msofficecomm/ConnectionPoint.h new file mode 100644 index 0000000..6c62936 --- /dev/null +++ b/src/native/windows/msofficecomm/ConnectionPoint.h @@ -0,0 +1,310 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_CONNECTIONPOINT_H_ +#define _JMSOFFICECOMM_CONNECTIONPOINT_H_ + +#include <ocidl.h> +#include <olectl.h> +#include <stdint.h> +#include "UnknownImpl.h" + +template <class T, REFIID IID_T> +class ConnectionPoint + : public IConnectionPoint, + public T +{ +public: + ConnectionPoint(IConnectionPointContainer *container) + : _container(container), + _sinkCount(0), + _sinks(NULL) + { + } + + virtual ~ConnectionPoint() + { + if (_sinks) + ::free(_sinks); + } + + // IUnknown + STDMETHODIMP QueryInterface(REFIID iid, PVOID *obj) + { + HRESULT hr; + + if (!obj) + hr = E_POINTER; + else if (IID_IUnknown == iid) + { + AddRef(); + *obj + = static_cast<LPUNKNOWN>( + static_cast<IConnectionPoint *>(this)); + hr = S_OK; + } + else if (IID_IConnectionPoint == iid) + { + AddRef(); + *obj = static_cast<IConnectionPoint *>(this); + hr = S_OK; + } + else + { + *obj = NULL; + hr = E_NOINTERFACE; + } + return hr; + } + + STDMETHODIMP_(ULONG) AddRef() { return _container->AddRef(); } + STDMETHODIMP_(ULONG) Release() { return _container->Release(); } + + // IDispatch + STDMETHODIMP GetTypeInfoCount(UINT *) + STDMETHODIMP_E_NOTIMPL_STUB + STDMETHODIMP GetTypeInfo(UINT, LCID, LPTYPEINFO *) + STDMETHODIMP_E_NOTIMPL_STUB + STDMETHODIMP GetIDsOfNames(REFIID, LPOLESTR *, UINT, LCID, DISPID *) + STDMETHODIMP_E_NOTIMPL_STUB + STDMETHODIMP Invoke(DISPID, REFIID, LCID, WORD, DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *) + STDMETHODIMP_E_NOTIMPL_STUB + + // IConnectionPoint + STDMETHODIMP GetConnectionInterface(IID *pIID) + { + HRESULT hr; + + if (pIID) + { + *pIID = IID_T; + hr = S_OK; + } + else + hr = E_POINTER; + return hr; + } + + STDMETHODIMP GetConnectionPointContainer(IConnectionPointContainer **ppCPC) + { + HRESULT hr; + + if (ppCPC) + { + _container->AddRef(); + *ppCPC = _container; + hr = S_OK; + } + else + hr = E_POINTER; + return hr; + } + + STDMETHODIMP Advise(IUnknown *pUnkSink, DWORD *pdwCookie) + { + HRESULT hr; + + if (pdwCookie) + { + if (pUnkSink) + { + T *t; + + if (SUCCEEDED( + pUnkSink->QueryInterface(IID_T, (PVOID *) &t))) + { + LPDISPATCH iDispatch; + + if (SUCCEEDED( + t->QueryInterface( + IID_IDispatch, + (PVOID *) &iDispatch))) + { + if (addSink(iDispatch)) + { + *pdwCookie + = (DWORD) + (((intptr_t) iDispatch) & 0xffffffff); + hr = S_OK; + } + else + { + *pdwCookie = 0; + hr = CONNECT_E_CANNOTCONNECT; + } + iDispatch->Release(); + } + else + { + *pdwCookie = 0; + hr = CONNECT_E_CANNOTCONNECT; + } + + t->Release(); + } + else + { + *pdwCookie = 0; + hr = CONNECT_E_CANNOTCONNECT; + } + } + else + { + *pdwCookie = 0; + hr = E_POINTER; + } + } + else + hr = E_POINTER; + return hr; + } + + STDMETHODIMP Unadvise(DWORD dwCookie) + { + size_t i = 0; + LPDISPATCH *ptr = _sinks; + HRESULT hr = E_POINTER; + + for (; i < _sinkCount; i++, ptr++) + { + LPDISPATCH iDispatch = *ptr; + + if (iDispatch + && (dwCookie + == (DWORD) + (((intptr_t) iDispatch) & 0xffffffff))) + { + *ptr = NULL; + iDispatch->Release(); + + _sinkCount--; + /* + * Move the emptied slot of the _sinks storage at the end + * where it is not accessible given the value of _sinkCount. + * Its memory is retained but it will either be used during + * a subsequent addSink(LPDISPATCH) or be freed upon + * deleting this ConnectionPoint. + */ + for (; i < _sinkCount; i++) + { + LPDISPATCH *nextPtr = ptr + 1; + + *ptr = *nextPtr; + ptr = nextPtr; + } + + hr = S_OK; + break; + } + } + return hr; + } + + STDMETHODIMP EnumConnections(IEnumConnections **ppEnum) + STDMETHODIMP_E_NOTIMPL_STUB + +protected: + HRESULT Invoke(DISPID dispIdMember, DISPPARAMS *pDispParams) + { + LPDISPATCH *sinks = getSinks(); + HRESULT hr; + + if (sinks) + { + for (LPDISPATCH sink, *sinkIt = sinks; + (sink = *sinkIt); + sinkIt++) + { + hr + = sink->Invoke( + dispIdMember, + IID_NULL, + 0, + DISPATCH_METHOD, + pDispParams, + NULL, + NULL, + NULL); + sink->Release(); + } + ::free(sinks); + + hr = S_OK; + } + else + hr = E_OUTOFMEMORY; + return hr; + } + +private: + BOOL addSink(LPDISPATCH sink) + { + BOOL b; + + if (containsSink(sink)) + b = FALSE; + else + { + size_t newSinkCount = _sinkCount + 1; + LPDISPATCH *newSinks + = (LPDISPATCH *) + ::realloc(_sinks, newSinkCount * sizeof(LPDISPATCH)); + + if (newSinks) + { + sink->AddRef(); + newSinks[newSinkCount - 1] = sink; + _sinkCount = newSinkCount; + _sinks = newSinks; + b = TRUE; + } + else + b = FALSE; + } + return b; + } + + BOOL containsSink(const LPDISPATCH sink) + { + size_t i = 0; + LPDISPATCH *ptr = _sinks; + + for (; i < _sinkCount; i++, ptr++) + if (sink == *ptr) + return TRUE; + return FALSE; + } + + LPDISPATCH *getSinks() + { + LPDISPATCH *sinks + = (LPDISPATCH *) + ::malloc((_sinkCount + 1) * sizeof(LPDISPATCH)); + + if (sinks) + { + size_t i = 0; + LPDISPATCH *dst = sinks; + LPDISPATCH *src = _sinks; + + for (; i < _sinkCount; i++, src++, dst++) + { + LPDISPATCH sink = *src; + + sink->AddRef(); + *dst = sink; + } + *dst = NULL; + } + return sinks; + } + + IConnectionPointContainer *_container; + size_t _sinkCount; + LPDISPATCH *_sinks; +}; + +#endif /* #ifndef _JMSOFFICECOMM_CONNECTIONPOINT_H_ */ diff --git a/src/native/windows/msofficecomm/DMessengerEventsConnectionPoint.cxx b/src/native/windows/msofficecomm/DMessengerEventsConnectionPoint.cxx new file mode 100644 index 0000000..b20982c --- /dev/null +++ b/src/native/windows/msofficecomm/DMessengerEventsConnectionPoint.cxx @@ -0,0 +1,32 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "DMessengerEventsConnectionPoint.h" + +#include <msgruaid.h> + +STDMETHODIMP +DMessengerEventsConnectionPoint::OnContactStatusChange + (LPDISPATCH pMContact, MISTATUS mStatus) +{ + const UINT argc = 2; + VARIANTARG argv[argc]; + + for (UINT i = 0; i < argc; i++) + ::VariantInit(argv + i); + argv[1].vt = VT_DISPATCH; + argv[1].pdispVal = pMContact; + argv[0].vt = VT_I4; + argv[0].lVal = (LONG) mStatus; + + DISPPARAMS dispParams; + + ::ZeroMemory(&dispParams, sizeof(DISPPARAMS)); + dispParams.cArgs = argc; + dispParams.rgvarg = argv; + + return Invoke(DISPID_MUAE_ONUSERSTATECHANGE, &dispParams); +} diff --git a/src/native/windows/msofficecomm/DMessengerEventsConnectionPoint.h b/src/native/windows/msofficecomm/DMessengerEventsConnectionPoint.h new file mode 100644 index 0000000..771b3f6 --- /dev/null +++ b/src/native/windows/msofficecomm/DMessengerEventsConnectionPoint.h @@ -0,0 +1,24 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_DMESSENGEREVENTSCONNECTIONPOINT_H_ +#define _JMSOFFICECOMM_DMESSENGEREVENTSCONNECTIONPOINT_H_ + +#include "ConnectionPoint.h" +#include <msgrua.h> + +class DMessengerEventsConnectionPoint + : public ConnectionPoint<DMessengerEvents, DIID_DMessengerEvents> +{ +public: + DMessengerEventsConnectionPoint(IConnectionPointContainer *container) + : ConnectionPoint(container) {} + virtual ~DMessengerEventsConnectionPoint() {} + + STDMETHODIMP OnContactStatusChange(LPDISPATCH pMContact, MISTATUS mStatus); +}; + +#endif /* #ifndef _JMSOFFICECOMM_DMESSENGEREVENTSCONNECTIONPOINT_H_ */ diff --git a/src/native/windows/msofficecomm/DispatchImpl.h b/src/native/windows/msofficecomm/DispatchImpl.h new file mode 100644 index 0000000..f7abcbe --- /dev/null +++ b/src/native/windows/msofficecomm/DispatchImpl.h @@ -0,0 +1,172 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_DISPATCHIMPL_H_ +#define _JMSOFFICECOMM_DISPATCHIMPL_H_ + +#include <oaidl.h> +#include "UnknownImpl.h" + +/** + * Represents a base implementation of the <tt>IDispatch</tt> interface. + * + * @author Lyubomir Marinov + */ +template <class T, REFIID IID_T> +class DispatchImpl + : public UnknownImpl<T, IID_T> +{ +public: + // IUnknown + STDMETHODIMP QueryInterface(REFIID iid, PVOID *obj) + { + HRESULT ret; + + if (obj) + { + if (IID_IDispatch == iid) + { + static_cast<LPUNKNOWN>(this)->AddRef(); + *obj = static_cast<LPDISPATCH>(this); + ret = S_OK; + } + else + ret = UnknownImpl<T, IID_T>::QueryInterface(iid, obj); + } + else + ret = E_POINTER; + return ret; + } + + // IDispatch + STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) +#ifdef DISPATCHIMPL_CREATESTDDISPATCH + { + LPDISPATCH iDispatch = getIDispatch(); + HRESULT hr; + + if (iDispatch) + hr = iDispatch->GetTypeInfoCount(pctinfo); + else if (pctinfo) + { + *pctinfo = 0; + hr = S_OK; + } + else + hr = E_INVALIDARG; + return hr; + } +#else + STDMETHODIMP_E_NOTIMPL_STUB +#endif /* #ifdef DISPATCHIMPL_CREATESTDDISPATCH */ + + STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO *ppTInfo) +#ifdef DISPATCHIMPL_CREATESTDDISPATCH + { + LPDISPATCH iDispatch = getIDispatch(); + HRESULT hr; + + if (iDispatch) + hr = iDispatch->GetTypeInfo(iTInfo, lcid, ppTInfo); + else if (ppTInfo) + { + *ppTInfo = NULL; + hr = TYPE_E_ELEMENTNOTFOUND; + } + else + hr = E_INVALIDARG; + return hr; + } +#else + STDMETHODIMP_E_NOTIMPL_STUB +#endif /* #ifdef DISPATCHIMPL_CREATESTDDISPATCH */ + + STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +#ifdef DISPATCHIMPL_CREATESTDDISPATCH + { + LPDISPATCH iDispatch = getIDispatch(); + HRESULT hr; + + if (iDispatch) + hr = iDispatch->GetIDsOfNames(riid, rgszNames, cNames, lcid, rgDispId); + else + hr = TYPE_E_ELEMENTNOTFOUND; + return hr; + } +#else + STDMETHODIMP_E_NOTIMPL_STUB +#endif /* #ifdef DISPATCHIMPL_CREATESTDDISPATCH */ + + STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +#ifdef DISPATCHIMPL_CREATESTDDISPATCH + { + LPDISPATCH iDispatch = getIDispatch(); + HRESULT hr; + + if (iDispatch) + hr = iDispatch->Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + else + hr = TYPE_E_ELEMENTNOTFOUND; + return hr; + } +#else + STDMETHODIMP_E_NOTIMPL_STUB +#endif /* #ifdef DISPATCHIMPL_CREATESTDDISPATCH */ + +protected: + DispatchImpl() : _iDispatch(NULL) {}; + + virtual ~DispatchImpl() + { + if (_iDispatch) + { + _iDispatch->Release(); + _iDispatch = NULL; + } + } + +private: +#ifdef DISPATCHIMPL_CREATESTDDISPATCH + LPDISPATCH getIDispatch() + { + if (!_iDispatch) + { + LPTYPEINFO iTypeInfo; + + if (SUCCEEDED( + OutOfProcessServer::getTypeInfoOfGuid( + IID_T, + &iTypeInfo))) + { + LPUNKNOWN iUnknown; + + if (SUCCEEDED( + ::CreateStdDispatch( + this, + this, + iTypeInfo, + &iUnknown))) + { + LPDISPATCH iDispatch; + + if (SUCCEEDED( + iUnknown->QueryInterface( + IID_IDispatch, + (PVOID *) &iDispatch))) + _iDispatch = iDispatch; + iUnknown->Release(); + } + iTypeInfo->Release(); + } + } + return _iDispatch; + } +#endif /* #ifdef DISPATCHIMPL_CREATESTDDISPATCH */ + + LPDISPATCH _iDispatch; +}; + +#endif /* #ifndef _JMSOFFICECOMM_DISPATCHIMPL_H_ */ diff --git a/src/native/windows/msofficecomm/IWeakReference.cxx b/src/native/windows/msofficecomm/IWeakReference.cxx new file mode 100644 index 0000000..f9feebb --- /dev/null +++ b/src/native/windows/msofficecomm/IWeakReference.cxx @@ -0,0 +1,10 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "IWeakReference.h" + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IWeakReference + = { 0xc59ff8e2, 0xf328, 0x4c93, { 0xa6, 0x2d, 0xe5, 0x03, 0x27, 0x20, 0x0a, 0x4a } }; diff --git a/src/native/windows/msofficecomm/IWeakReference.h b/src/native/windows/msofficecomm/IWeakReference.h new file mode 100644 index 0000000..301ec3d --- /dev/null +++ b/src/native/windows/msofficecomm/IWeakReference.h @@ -0,0 +1,25 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_IWEAKREFERENCE_H_ +#define _JMSOFFICECOMM_IWEAKREFERENCE_H_ + +#include <unknwn.h> + +EXTERN_C const IID IID_IWeakReference; + +#undef INTERFACE /* Silence a possible redefinition warning. */ +#define INTERFACE IWeakReference +DECLARE_INTERFACE_(IWeakReference,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID *) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(Resolve)(THIS_ REFIID, PVOID *) PURE; +}; +#undef INTERFACE + +#endif /* #ifndef _JMSOFFICECOMM_IWEAKREFERENCE_H_ */ diff --git a/src/native/windows/msofficecomm/IWeakReferenceSource.cxx b/src/native/windows/msofficecomm/IWeakReferenceSource.cxx new file mode 100644 index 0000000..5552dd6 --- /dev/null +++ b/src/native/windows/msofficecomm/IWeakReferenceSource.cxx @@ -0,0 +1,10 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "IWeakReferenceSource.h" + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IWeakReferenceSource + = { 0xcb401dba, 0xadbe, 0x4d7a, { 0x82, 0x75, 0xe2, 0xc4, 0xb7, 0xf9, 0x5c, 0xe0 } }; diff --git a/src/native/windows/msofficecomm/IWeakReferenceSource.h b/src/native/windows/msofficecomm/IWeakReferenceSource.h new file mode 100644 index 0000000..7102925 --- /dev/null +++ b/src/native/windows/msofficecomm/IWeakReferenceSource.h @@ -0,0 +1,25 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_IWEAKREFERENCESOURCE_H_ +#define _JMSOFFICECOMM_IWEAKREFERENCESOURCE_H_ + +#include "IWeakReference.h" + +EXTERN_C const IID IID_IWeakReferenceSource; + +#undef INTERFACE /* Silence a possible redefinition warning. */ +#define INTERFACE IWeakReferenceSource +DECLARE_INTERFACE_(IWeakReferenceSource,IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID *) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + STDMETHOD(GetWeakReference)(THIS_ IWeakReference **) PURE; +}; +#undef INTERFACE + +#endif /* #ifndef _JMSOFFICECOMM_IWEAKREFERENCESOURCE_H_ */ diff --git a/src/native/windows/msofficecomm/Log.cxx b/src/native/windows/msofficecomm/Log.cxx new file mode 100644 index 0000000..85419c9 --- /dev/null +++ b/src/native/windows/msofficecomm/Log.cxx @@ -0,0 +1,140 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "Log.h" + +#include <stdarg.h> +#include "StringUtils.h" + +FILE *Log::_stderr = NULL; + +#ifdef _UNICODE +int Log::d(LPCTSTR format, LPCSTR str) +{ + LPWSTR wstr = StringUtils::MultiByteToWideChar(str); + int ret; + + if (wstr) + { + ret = Log::d(format, wstr); + ::free(wstr); + } + else + ret = 0; + return ret; +} +#endif /* #ifdef _UNICODE */ + +int Log::d(LPCTSTR format, ...) +{ + va_list args; + + va_start(args, format); + + int ret = ::_vftprintf(_stderr, format, args); + + ::fflush(_stderr); + return ret; +} + +LPTSTR Log::getModuleFileName() +{ + HMODULE module; + LPTSTR ret = NULL; + + if (::GetModuleHandleEx( + GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS + | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + (LPCTSTR) (Log::getModuleFileName), + &module)) + { + TCHAR path[MAX_PATH + 1]; + DWORD pathCapacity = sizeof(path) / sizeof(TCHAR); + DWORD pathLength = ::GetModuleFileName(module, path, pathCapacity); + + if (pathLength && (pathLength < pathCapacity)) + { + LPTSTR fileName = NULL; + + for (LPTSTR str = path + (pathLength - 1); str != path; str--) + { + TCHAR ch = *str; + + if ((ch == '\\') || (ch == '/')) + { + fileName = str + 1; + break; + } + else if (ch == '.') + *str = '\0'; + } + if (fileName && (*fileName != '\0')) + ret = ::_tcsdup(fileName); + } + } + return ret; +} + +FILE *Log::open() +{ + LPCTSTR envVarName = _T("USERPROFILE"); + DWORD envVarValueLength1 = ::GetEnvironmentVariable(envVarName, NULL, 0); + FILE *_stderr = NULL; + + if (envVarValueLength1) + { + LPTSTR moduleFileName = getModuleFileName(); + + if (moduleFileName) + { + LPCTSTR tracing = _T("\\Tracing\\"); + size_t tracingLength = ::_tcslen(tracing); + size_t tracingSize = sizeof(TCHAR) * tracingLength; + size_t moduleFileNameLength = ::_tcslen(moduleFileName); + size_t moduleFileNameSize = sizeof(TCHAR) * moduleFileNameLength; + LPCTSTR log = _T(".log"); + size_t logLength = ::_tcslen(log); + size_t logSize = sizeof(TCHAR) * logLength; + LPTSTR logPath + = (LPTSTR) + ::malloc( + sizeof(TCHAR) * envVarValueLength1 + + tracingSize + + moduleFileNameSize + + logSize); + + if (logPath) + { + DWORD envVarValueLength + = ::GetEnvironmentVariable( + envVarName, + logPath, + envVarValueLength1); + + if (envVarValueLength + && (envVarValueLength < envVarValueLength1)) + { + LPTSTR str = logPath + envVarValueLength; + + ::memcpy(str, tracing, tracingSize); + str += tracingLength; + ::memcpy(str, moduleFileName, moduleFileNameSize); + str += moduleFileNameLength; + ::memcpy(str, log, logSize); + str += logLength; + *str = '\0'; + + _stderr = ::_tfopen(logPath, _T("w")); + } + ::free(logPath); + } + ::free(moduleFileName); + } + } + + Log::_stderr = _stderr ? _stderr : stderr; + return Log::_stderr; +} diff --git a/src/native/windows/msofficecomm/Log.h b/src/native/windows/msofficecomm/Log.h new file mode 100644 index 0000000..aa71ae9 --- /dev/null +++ b/src/native/windows/msofficecomm/Log.h @@ -0,0 +1,38 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_LOG_H_ +#define _JMSOFFICECOMM_LOG_H_ + +#include <stdio.h> +#include <tchar.h> +#include <windows.h> + +class Log +{ +public: + static void close() + { + if (_stderr && (_stderr != stderr)) + { + ::fclose(_stderr); + _stderr = stderr; + } + } + +#ifdef _UNICODE + static int d(LPCTSTR format, LPCSTR str); +#endif /* #ifdef _UNICODE */ + static int d(LPCTSTR format, ...); + static FILE *open(); + +private: + static LPTSTR getModuleFileName(); + + static FILE *_stderr; +}; + +#endif /* #ifndef _JMSOFFICECOMM_LOG_H_ */ diff --git a/src/native/windows/msofficecomm/Messenger.cxx b/src/native/windows/msofficecomm/Messenger.cxx new file mode 100644 index 0000000..41f42ba --- /dev/null +++ b/src/native/windows/msofficecomm/Messenger.cxx @@ -0,0 +1,876 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "Messenger.h" + +#include "ConnectionPoint.h" +#include "MessengerContact.h" +#include "MessengerContacts.h" +#include "MessengerServices.h" +#include "net_java_sip_communicator_plugin_msofficecomm_Messenger.h" +#include <olectl.h> + +EXTERN_C const GUID DECLSPEC_SELECTANY DIID_DMessengerEvents + = { 0xC9A6A6B6, 0x9BC1, 0x43a5, { 0xB0, 0x6B, 0xE5, 0x88, 0x74, 0xEE, 0xBC, 0x96 } }; + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_ICallFactory + = { 0x1c733a30, 0x2a1c, 0x11ce, { 0xad, 0xe5, 0x00, 0xaa, 0x00, 0x44, 0x77, 0x3d } }; + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessenger + = { 0xD50C3186, 0x0F89, 0x48f8, { 0xB2, 0x04, 0x36, 0x04, 0x62, 0x9D, 0xEE, 0x10 } }; + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessenger2 + = { 0xD50C3286, 0x0F89, 0x48f8, { 0xB2, 0x04, 0x36, 0x04, 0x62, 0x9D, 0xEE, 0x10 } }; + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessenger3 + = { 0xD50C3386, 0x0F89, 0x48f8, { 0xB2, 0x04, 0x36, 0x04, 0x62, 0x9D, 0xEE, 0x10 } }; + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessengerAdvanced + = { 0xDA0635E8, 0x09AF, 0x480c, { 0x88, 0xB2, 0xAA, 0x9F, 0xA1, 0xD9, 0xDB, 0x27 } }; + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessengerContactResolution + = { 0x53A5023D, 0x6872, 0x454a, { 0x9A, 0x4F, 0x82, 0x7F, 0x18, 0xCF, 0xBE, 0x02 } }; + +class OnContactStatusChangeEvent +{ +public: + OnContactStatusChangeEvent(BSTR signinName, MISTATUS status) + : _signinName(signinName), _status(status) {} + ~OnContactStatusChangeEvent() + { ::SysFreeString(_signinName); } + + BSTR _signinName; + MISTATUS _status; +}; + +JNIEXPORT void JNICALL +Java_net_java_sip_communicator_plugin_msofficecomm_Messenger_onContactStatusChange + (JNIEnv *env, jclass clazz, jstring signinName, jint status) +{ + const jchar *chars = env->GetStringChars(signinName, NULL); + + if (chars) + { + BSTR bstr = ::SysAllocString((LPOLESTR) chars); + + env->ReleaseStringChars(signinName, chars); + if (bstr) + { + OnContactStatusChangeEvent *event + = new OnContactStatusChangeEvent(bstr, (MISTATUS) status); + + Messenger::onContactStatusChange((ULONG_PTR) event); + } + } +} + +jclass Messenger::_jclass = NULL; +jmethodID Messenger::_jctorMethodID = NULL; +jmethodID Messenger::_jstartConversationMethodID = NULL; +Messenger *Messenger::_singleton = NULL; + +Messenger::Messenger() + : _dMessengerEventsConnectionPoint(NULL), + _jobject(NULL), + _messengerContactCount(0), + _messengerContacts(NULL), + _myContacts(NULL), + _services(NULL) +{ + if (SUCCEEDED(::StringFromCLSID(CLSID_Messenger, &_myServiceId))) + constructJobject(); + else + _myServiceId = NULL; + + _singleton = this; +} + +Messenger::~Messenger() +{ + if (_singleton == this) + _singleton = NULL; + + if (_dMessengerEventsConnectionPoint) + delete _dMessengerEventsConnectionPoint; + if (_jobject) + destructJobject(); + + // _messengerContacts + if (_messengerContactCount) + { + size_t i = 0; + IWeakReference **messengerContactIt = _messengerContacts; + + for (; i < _messengerContactCount; i++, messengerContactIt++) + (*messengerContactIt)->Release(); + ::free(_messengerContacts); + } + + if (_myContacts) + _myContacts->Release(); + if (_myServiceId) + ::CoTaskMemFree(_myServiceId); + if (_services) + _services->Release(); +} + +STDMETHODIMP Messenger::AddContact(long hwndParent, BSTR bstrEMail) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::AutoSignin() + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::CreateGroup(BSTR bstrName, VARIANT vService, IDispatch **ppGroup) + STDMETHODIMP_E_NOTIMPL_STUB + +HRESULT Messenger::constructJobject() +{ + JavaVM *vm = OutOfProcessServer::getJavaVM(); + JNIEnv *env; + HRESULT hr; + + if (vm && !(vm->AttachCurrentThreadAsDaemon((void **) &env, NULL))) + { + jobject o = env->NewObject(_jclass, _jctorMethodID); + + if (o) + { + o = env->NewGlobalRef(o); + if (o) + { + if (_jobject) + env->DeleteGlobalRef(_jobject); + _jobject = o; + hr = S_OK; + } + else + hr = E_OUTOFMEMORY; + } + else + hr = E_FAIL; + + /* + * The constructJobject(LPCOLESTR) method is called as part of the + * Messenger constructor which does not return an error code so any Java + * exception should be cleared in order to prevent unexpected behavior + * on the side of the Java VM. + */ + if (FAILED(hr)) + env->ExceptionClear(); + } + else + hr = E_UNEXPECTED; + return hr; +} + +HRESULT +Messenger::createMessengerContact(BSTR signinName, REFIID iid, PVOID *obj) +{ + MessengerContact *messengerContact = new MessengerContact(this, signinName); + HRESULT hr; + + if (messengerContact) + { + hr = messengerContact->QueryInterface(iid, obj); + + /* + * We've created a new instance and we've asked it about the requested + * interface. What follows is keeping track of the instance for the + * specified signin name in order to try to avoid having multiple + * instances for one and the same signin name at one and the same time + * (because MSDN mentions it) and it is not vital. + */ + if (SUCCEEDED(hr)) + { + IWeakReferenceSource *weakReferenceSource; + + if (SUCCEEDED( + messengerContact->QueryInterface( + IID_IWeakReferenceSource, + (PVOID *) &weakReferenceSource))) + { + IWeakReference *weakReference; + + if (SUCCEEDED( + weakReferenceSource->GetWeakReference(&weakReference))) + { + size_t newMessengerContactCount = _messengerContactCount + 1; + IWeakReference **newMessengerContacts + = (IWeakReference **) + ::realloc( + _messengerContacts, + newMessengerContactCount + * sizeof(IWeakReference *)); + + if (newMessengerContacts) + { + newMessengerContacts[newMessengerContactCount - 1] + = weakReference; + _messengerContactCount = newMessengerContactCount; + _messengerContacts = newMessengerContacts; + } + else + weakReference->Release(); + } + weakReferenceSource->Release(); + } + } + + messengerContact->Release(); + } + else + { + *obj = NULL; + hr = E_OUTOFMEMORY; + } + return hr; +} + +HRESULT Messenger::destructJobject() +{ + JavaVM *vm = OutOfProcessServer::getJavaVM(); + JNIEnv *env; + HRESULT hr; + + if (vm && !(vm->AttachCurrentThreadAsDaemon((void **) &env, NULL))) + { + env->DeleteGlobalRef(_jobject); + _jobject = NULL; + hr = S_OK; + } + else + hr = E_UNEXPECTED; + return hr; +} + +STDMETHODIMP Messenger::EnumConnectionPoints(IEnumConnectionPoints **ppEnum) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::FindConnectionPoint(REFIID riid, IConnectionPoint **ppCP) +{ + HRESULT hr; + + if (ppCP) + { + if (DIID_DMessengerEvents == riid) + { + if (!_dMessengerEventsConnectionPoint) + { + _dMessengerEventsConnectionPoint + = new DMessengerEventsConnectionPoint(this); + } + _dMessengerEventsConnectionPoint->AddRef(); + *ppCP = _dMessengerEventsConnectionPoint; + hr = S_OK; + } + else + { + *ppCP = NULL; + hr = CONNECT_E_NOCONNECTION; + } + } + else + hr = E_POINTER; + return hr; +} + +STDMETHODIMP Messenger::FindContact(long hwndParent, BSTR bstrFirstName, BSTR bstrLastName, VARIANT vbstrCity, VARIANT vbstrState, VARIANT vbstrCountry) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_ContactsSortOrder(MUASORT *pSort) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_MyContacts(IDispatch **ppMContacts) + STDMETHODIMP_RESOLVE_WEAKREFERENCE_OR_NEW(ppMContacts,_myContacts,MessengerContacts,this) + +STDMETHODIMP Messenger::get_MyFriendlyName(BSTR *pbstrName) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_MyGroups(IDispatch **ppMGroups) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_MyPhoneNumber(MPHONE_TYPE PhoneType, BSTR *pbstrNumber) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_MyProperty(MCONTACTPROPERTY ePropType, VARIANT *pvPropVal) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_MyServiceId(BSTR *pbstrServiceId) +{ + HRESULT hr; + + if (pbstrServiceId) + { + if (_myServiceId) + { + hr + = ((*pbstrServiceId = ::SysAllocString(_myServiceId))) + ? S_OK + : E_OUTOFMEMORY; + } + else + { + *pbstrServiceId = NULL; + hr = E_FAIL; + } + } + else + hr = E_INVALIDARG; + return hr; +} + +STDMETHODIMP Messenger::get_MyServiceName(BSTR *pbstrServiceName) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_MySigninName(BSTR *pbstrName) +{ + return get_MyServiceId(pbstrName); +} + +STDMETHODIMP Messenger::get_MyStatus(MISTATUS *pmStatus) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_Property(MMESSENGERPROPERTY ePropType, VARIANT *pvPropVal) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_ReceiveFileDirectory(BSTR *bstrPath) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_Services(IDispatch **ppdispServices) + STDMETHODIMP_RESOLVE_WEAKREFERENCE_OR_NEW(ppdispServices,_services,MessengerServices,this) + +STDMETHODIMP Messenger::get_UnreadEmailCount(MUAFOLDER mFolder, LONG *plCount) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::get_Window(IDispatch **ppMWindow) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::GetAuthenticationInfo(BSTR *pbstrAuthInfo) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP +Messenger::GetContact(BSTR bstrSigninName, BSTR bstrServiceId, IDispatch **ppMContact) +{ + HRESULT hr; + + if (ppMContact) + { + if (bstrSigninName) + { + /* + * Try to find an existing MessengerContact instance which has not + * been released to deletion yet and which has the specified signin + * name. + */ + hr + = getMessengerContact( + bstrSigninName, + IID_IDispatch, + (PVOID *) ppMContact); + if (FAILED(hr)) + { + /* + * Try to find a contact with the specified signin name in the + * MyContacts collection of this Messenger. + */ + LPDISPATCH iDispatch; + + hr = get_MyContacts(&iDispatch); + if (SUCCEEDED(hr)) + { + IMessengerContacts *myContacts; + + hr + = iDispatch->QueryInterface( + IID_IMessengerContacts, + (PVOID *) &myContacts); + iDispatch->Release(); + if (SUCCEEDED(hr)) + { + LONG myContactCount; + + hr = myContacts->get_Count(&myContactCount); + if (SUCCEEDED(hr)) + { + for (LONG i = 0; i < myContactCount; i++) + { + hr = myContacts->Item(i, &iDispatch); + if (SUCCEEDED(hr)) + { + if (MessengerContact::signinNameEquals( + iDispatch, + bstrSigninName)) + { + *ppMContact = iDispatch; + break; + } + else + iDispatch->Release(); + } + else + break; + } + } + myContacts->Release(); + } + } + + if (FAILED(hr) || !(*ppMContact)) + { + hr + = createMessengerContact( + bstrSigninName, + IID_IDispatch, + (PVOID *) ppMContact); + } + } + } + else + { + *ppMContact = NULL; + hr = E_FAIL; + } + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} + +HRESULT Messenger::getMessengerContact(BSTR signinName, REFIID iid, PVOID *obj) +{ + *obj = NULL; + + size_t i = 0; + IWeakReference **messengerContactIt = _messengerContacts; + HRESULT hr = E_FAIL; + + while (i < _messengerContactCount) + { + IWeakReference *weakReference = *messengerContactIt; + LPDISPATCH iDispatch; + + hr = weakReference->Resolve(IID_IDispatch, (PVOID *) &iDispatch); + if (SUCCEEDED(hr)) + { + if (MessengerContact::signinNameEquals(iDispatch, signinName)) + { + if (IID_IDispatch == iid) + *obj = iDispatch; + else + { + hr = weakReference->Resolve(iid, obj); + iDispatch->Release(); + } + break; + } + else + iDispatch->Release(); + + i++; + messengerContactIt++; + } + else if (E_NOINTERFACE != hr) + { + /* + * The weakReference appears to have been invalidated. Release the + * resources associated with it. + */ + *messengerContactIt = NULL; + weakReference->Release(); + + _messengerContactCount--; + + /* + * Move the emptied slot of the _messengerContacts storage at the + * end where it is not accessible given the value of + * _messengerContactCount. + */ + size_t j = i; + IWeakReference **it = messengerContactIt; + + for (; j < _messengerContactCount; j++) + { + IWeakReference **nextIt = it + 1; + + *it = *nextIt; + it = nextIt; + } + } + } + + if (SUCCEEDED(hr) && !(*obj)) + hr = E_FAIL; + return hr; +} + +STDMETHODIMP Messenger::InstantMessage(VARIANT vContact, IDispatch **ppMWindow) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::InviteApp(VARIANT vContact, BSTR bstrAppID, IDispatch **ppMWindow) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::MediaWizard(long hwndParent) + STDMETHODIMP_E_NOTIMPL_STUB + +void CALLBACK Messenger::onContactStatusChange(ULONG_PTR dwParam) +{ + BOOL run; + + OutOfProcessServer::enterCriticalSection(); + + HANDLE threadHandle = OutOfProcessServer::getThreadHandle(); + + if (threadHandle) + { + run = (::GetCurrentThreadId() == OutOfProcessServer::getThreadId()); + if (!run + && !::QueueUserAPC( + onContactStatusChange, + threadHandle, + dwParam)) + { + delete (OnContactStatusChangeEvent *) dwParam; + } + } + else + { + run = FALSE; + delete (OnContactStatusChangeEvent *) dwParam; + } + + OutOfProcessServer::leaveCriticalSection(); + + if (run) + { + Messenger *thiz = _singleton; + OnContactStatusChangeEvent *event + = (OnContactStatusChangeEvent *) dwParam; + + if (thiz && thiz->_dMessengerEventsConnectionPoint) + { + HRESULT hr; + LPDISPATCH contact; + + hr = thiz->GetContact(event->_signinName, NULL, &contact); + if (SUCCEEDED(hr)) + { + hr + = thiz->_dMessengerEventsConnectionPoint + ->OnContactStatusChange(contact, event->_status); + contact->Release(); + } + } + + delete event; + } +} + +STDMETHODIMP Messenger::OpenInbox() + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::OptionsPages(long hwndParent, MOPTIONPAGE mOptionPage) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::Page(VARIANT vContact, IDispatch **ppMWindow) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::Phone(VARIANT vContact, MPHONE_TYPE ePhoneNumber, BSTR bstrNumber, IDispatch **ppMWindow) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::put_ContactsSortOrder(MUASORT Sort) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::put_MyProperty(MCONTACTPROPERTY ePropType, VARIANT vPropVal) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::put_MyStatus(MISTATUS mStatus) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::put_Property(MMESSENGERPROPERTY ePropType, VARIANT vPropVal) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::QueryInterface(REFIID iid, PVOID *obj) +{ + HRESULT hr; + + if (!obj) + hr = E_POINTER; + else if (IID_IMessenger == iid) + { + AddRef(); + *obj = static_cast<IMessenger *>(this); + hr = S_OK; + } + else if (IID_IMessenger2 == iid) + { + AddRef(); + *obj = static_cast<IMessenger2 *>(this); + hr = S_OK; + } + else if (IID_IMessenger3 == iid) + { + AddRef(); + *obj = static_cast<IMessenger3 *>(this); + hr = S_OK; + } + else if (IID_IMessengerAdvanced == iid) + { + AddRef(); + *obj = static_cast<IMessengerAdvanced *>(this); + hr = S_OK; + } + else if (IID_IConnectionPointContainer == iid) + { + AddRef(); + *obj = static_cast<IConnectionPointContainer *>(this); + hr = S_OK; + } + else if (IID_IMessengerContactResolution == iid) + { + AddRef(); + *obj = static_cast<IMessengerContactResolution *>(this); + hr = S_OK; + } + else + hr = DispatchImpl::QueryInterface(iid, obj); + return hr; +} + +STDMETHODIMP +Messenger::ResolveContact(ADDRESS_TYPE AddressType, CONTACT_RESOLUTION_TYPE ResolutionType, BSTR bstrAddress, BSTR *pbstrIMAddress) +{ + HRESULT hr; + + if (pbstrIMAddress) + { + if (bstrAddress) + { + if (ADDRESS_TYPE_SMTP == AddressType) + { + hr + = ((*pbstrIMAddress = ::SysAllocString(bstrAddress))) + ? S_OK + : E_OUTOFMEMORY; + } + else + { + *pbstrIMAddress = NULL; + hr = E_NOTIMPL; + } + } + else + { + *pbstrIMAddress = NULL; + hr = E_INVALIDARG; + } + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} + +STDMETHODIMP Messenger::SendFile(VARIANT vContact, BSTR bstrFileName, IDispatch **ppMWindow) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::SendMail(VARIANT vContact) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::Signin(long hwndParent, BSTR bstrSigninName, BSTR bstrPassword) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::Signout() + STDMETHODIMP_E_NOTIMPL_STUB + +HRESULT Messenger::start(JNIEnv *env) +{ + LPSTR className = OutOfProcessServer::getClassName("Messenger"); + HRESULT hr; + + if (className) + { + jclass clazz = env->FindClass(className); + + ::free(className); + + if (clazz) + { + jmethodID ctorMethodID = env->GetMethodID(clazz, "<init>", "()V"); + + if (ctorMethodID) + { + jmethodID startConversationMethodID + = env->GetMethodID( + clazz, + "startConversation", + "(I[Ljava/lang/String;)V"); + + if (startConversationMethodID) + { + clazz = (jclass) env->NewGlobalRef(clazz); + if (clazz) + { + _jclass = clazz; + _jctorMethodID = ctorMethodID; + _jstartConversationMethodID = startConversationMethodID; + hr = S_OK; + } + else + hr = E_OUTOFMEMORY; + } + else + hr = E_FAIL; + } + else + hr = E_FAIL; + } + else + hr = E_FAIL; + } + else + hr = E_OUTOFMEMORY; + return hr; +} + +STDMETHODIMP +Messenger::StartConversation + (CONVERSATION_TYPE ConversationType, + VARIANT vParticipants, + VARIANT vContextualData, + VARIANT vSubject, + VARIANT vConversationIndex, + VARIANT vConversationData, + VARIANT *pvWndHnd) +{ + HRESULT hr; + + if (VT_ARRAY == (vParticipants.vt & VT_ARRAY)) + { + SAFEARRAY *sa = vParticipants.parray; + + if (sa + && (1 == sa->cDims) + && (FADF_VARIANT == (sa->fFeatures & FADF_VARIANT))) + { + jbyte *data; + + hr = ::SafeArrayAccessData(sa, (PVOID *) &data); + if (SUCCEEDED(hr)) + { + JavaVM *vm = OutOfProcessServer::getJavaVM(); + JNIEnv *env; + + if (vm + && !(vm->AttachCurrentThreadAsDaemon( + (void **) &env, + NULL))) + { + jclass stringClass = env->FindClass("java/lang/String"); + + if (stringClass) + { + SAFEARRAYBOUND *bound = sa->rgsabound; + ULONG length = bound->cElements; + jobjectArray participants + = env->NewObjectArray(length, stringClass, NULL); + + if (participants) + { + ULONG elemsize = sa->cbElements; + + data += bound->lLbound; + for (ULONG i = 0; i < length; i++, data += elemsize) + { + VARIANT *v = (VARIANT *) data; + BSTR bstr; + + if (VT_BSTR == v->vt) + bstr = v->bstrVal; + else if ((VT_BSTR | VT_BYREF) == v->vt) + bstr = *(v->pbstrVal); + else + { + hr = E_INVALIDARG; + break; + } + + jstring participant + = env->NewString( + (const jchar *) bstr, + ::SysStringLen(bstr)); + + if (participant) + { + env->SetObjectArrayElement( + participants, + i, + participant); + } + else + { + hr = E_OUTOFMEMORY; + break; + } + } + + if (SUCCEEDED(hr)) + { + if (_jobject) + { + env->CallVoidMethod( + _jobject, + _jstartConversationMethodID, + (jint) ConversationType, + participants); + if (env->ExceptionCheck()) + { + env->ExceptionClear(); + hr = E_FAIL; + } + } + else + hr = E_FAIL; + } + } + else + hr = E_OUTOFMEMORY; + } + else + hr = E_UNEXPECTED; + } + else + hr = E_UNEXPECTED; + ::SafeArrayUnaccessData(sa); + } + } + else + hr = E_INVALIDARG; + } + else + hr = E_INVALIDARG; + return hr; +} + +STDMETHODIMP Messenger::StartVideo(VARIANT vContact, IDispatch **ppMWindow) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP Messenger::StartVoice(VARIANT vContact, IDispatch **ppMWindow) + STDMETHODIMP_E_NOTIMPL_STUB + +HRESULT Messenger::stop(JNIEnv *env) +{ + jclass clazz = _jclass; + + _jclass = NULL; + _jctorMethodID = NULL; + _jstartConversationMethodID = NULL; + if (clazz) + env->DeleteGlobalRef(clazz); + + return S_OK; +} + +STDMETHODIMP Messenger::ViewProfile(VARIANT vContact) + STDMETHODIMP_E_NOTIMPL_STUB diff --git a/src/native/windows/msofficecomm/Messenger.h b/src/native/windows/msofficecomm/Messenger.h new file mode 100644 index 0000000..7a8051c --- /dev/null +++ b/src/native/windows/msofficecomm/Messenger.h @@ -0,0 +1,126 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_MESSENGER_H_ +#define _JMSOFFICECOMM_MESSENGER_H_ + +#include "DispatchImpl.h" +#include "DMessengerEventsConnectionPoint.h" +#include <msgrua.h> + +/** + * Implements the <tt>IMessenger</tt>, <tt>IMessenger2</tt>, + * <tt>IMessenger3</tt>, <tt>IMessengerAdvanced</tt> and + * <tt>IMessengerContactResolution</tt> interfaces. + * + * @author Lyubomir Marinov + */ +class Messenger + : public DispatchImpl<IMessengerAdvanced, IID_IMessengerAdvanced>, + public IConnectionPointContainer, + public IMessengerContactResolution +{ +public: + static void CALLBACK onContactStatusChange(ULONG_PTR dwParam); + static HRESULT start(JNIEnv *env); + static HRESULT stop(JNIEnv *env); + + Messenger(); + + // IUnknown + STDMETHODIMP QueryInterface(REFIID, PVOID *); + STDMETHODIMP_(ULONG) AddRef(THIS) { return DispatchImpl::AddRef(); }; + STDMETHODIMP_(ULONG) Release(THIS) { return DispatchImpl::Release(); }; + + // IDispatch + STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) + { return DispatchImpl::GetTypeInfoCount(pctinfo); }; + STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO *ppTInfo) + { return DispatchImpl::GetTypeInfo(iTInfo, lcid, ppTInfo); }; + STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) + { return DispatchImpl::GetIDsOfNames(riid, rgszNames, cNames, lcid, rgDispId); }; + STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) + { return DispatchImpl::Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); }; + + // IMessenger + STDMETHODIMP get_Window(IDispatch **ppMWindow); + STDMETHODIMP ViewProfile(VARIANT vContact); + STDMETHODIMP get_ReceiveFileDirectory(BSTR *bstrPath); + STDMETHODIMP StartVoice(VARIANT vContact, IDispatch **ppMWindow); + STDMETHODIMP InviteApp(VARIANT vContact, BSTR bstrAppID, IDispatch **ppMWindow); + STDMETHODIMP SendMail(VARIANT vContact); + STDMETHODIMP OpenInbox(); + STDMETHODIMP SendFile(VARIANT vContact, BSTR bstrFileName, IDispatch **ppMWindow); + STDMETHODIMP Signout(); + STDMETHODIMP Signin(long hwndParent, BSTR bstrSigninName, BSTR bstrPassword); + STDMETHODIMP GetContact(BSTR bstrSigninName, BSTR bstrServiceId, IDispatch **ppMContact); + STDMETHODIMP OptionsPages(long hwndParent, MOPTIONPAGE mOptionPage); + STDMETHODIMP AddContact(long hwndParent, BSTR bstrEMail); + STDMETHODIMP FindContact(long hwndParent, BSTR bstrFirstName, BSTR bstrLastName, VARIANT vbstrCity, VARIANT vbstrState, VARIANT vbstrCountry); + STDMETHODIMP InstantMessage(VARIANT vContact, IDispatch **ppMWindow); + STDMETHODIMP Phone(VARIANT vContact, MPHONE_TYPE ePhoneNumber, BSTR bstrNumber, IDispatch **ppMWindow); + STDMETHODIMP MediaWizard(long hwndParent); + STDMETHODIMP Page(VARIANT vContact, IDispatch **ppMWindow); + STDMETHODIMP AutoSignin(); + STDMETHODIMP get_MyContacts(IDispatch **ppMContacts); + STDMETHODIMP get_MySigninName(BSTR *pbstrName); + STDMETHODIMP get_MyFriendlyName(BSTR *pbstrName); + STDMETHODIMP put_MyStatus(MISTATUS mStatus); + STDMETHODIMP get_MyStatus(MISTATUS *pmStatus); + STDMETHODIMP get_UnreadEmailCount(MUAFOLDER mFolder, LONG *plCount); + STDMETHODIMP get_MyServiceName(BSTR *pbstrServiceName); + STDMETHODIMP get_MyPhoneNumber(MPHONE_TYPE PhoneType, BSTR *pbstrNumber); + STDMETHODIMP get_MyProperty(MCONTACTPROPERTY ePropType, VARIANT *pvPropVal); + STDMETHODIMP put_MyProperty(MCONTACTPROPERTY ePropType, VARIANT vPropVal); + STDMETHODIMP get_MyServiceId(BSTR *pbstrServiceId); + STDMETHODIMP get_Services(IDispatch **ppdispServices); + + // IMessenger2 + STDMETHODIMP get_ContactsSortOrder(MUASORT *pSort); + STDMETHODIMP put_ContactsSortOrder(MUASORT Sort); + STDMETHODIMP StartVideo(VARIANT vContact, IDispatch **ppMWindow); + STDMETHODIMP get_MyGroups(IDispatch **ppMGroups); + STDMETHODIMP CreateGroup(BSTR bstrName, VARIANT vService, IDispatch **ppGroup); + + // IMessenger3 + STDMETHODIMP get_Property(MMESSENGERPROPERTY ePropType, VARIANT *pvPropVal); + STDMETHODIMP put_Property(MMESSENGERPROPERTY ePropType, VARIANT vPropVal); + + // IMessengerAdvanced + STDMETHODIMP StartConversation(CONVERSATION_TYPE ConversationType, VARIANT vParticipants, VARIANT vContextualData, VARIANT vSubject, VARIANT vConversationIndex, VARIANT vConversationData, VARIANT *pvWndHnd); + STDMETHODIMP GetAuthenticationInfo(BSTR *pbstrAuthInfo); + + // IConnectionPointContainer + STDMETHODIMP EnumConnectionPoints(IEnumConnectionPoints **ppEnum); + STDMETHODIMP FindConnectionPoint(REFIID riid,IConnectionPoint **ppCP); + + // IMessengerContactResolution + STDMETHODIMP ResolveContact(ADDRESS_TYPE AddressType, CONTACT_RESOLUTION_TYPE ResolutionType, BSTR bstrAddress, BSTR *pbstrIMAddress); + +protected: + virtual ~Messenger(); + +private: + static jclass _jclass; + static jmethodID _jctorMethodID; + static jmethodID _jstartConversationMethodID; + static Messenger * _singleton; + + HRESULT constructJobject(); + HRESULT createMessengerContact(BSTR signinName, REFIID iid, PVOID *obj); + HRESULT destructJobject(); + HRESULT getMessengerContact(BSTR signinName, REFIID iid, PVOID *obj); + + DMessengerEventsConnectionPoint *_dMessengerEventsConnectionPoint; + jobject _jobject; + size_t _messengerContactCount; + IWeakReference ** _messengerContacts; + IWeakReference * _myContacts; + LPOLESTR _myServiceId; + IWeakReference * _services; +}; + +#endif /* #ifndef _JMSOFFICECOMM_MESSENGER_H_ */ diff --git a/src/native/windows/msofficecomm/MessengerClassFactory.cxx b/src/native/windows/msofficecomm/MessengerClassFactory.cxx new file mode 100644 index 0000000..2152df5 --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerClassFactory.cxx @@ -0,0 +1,66 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "MessengerClassFactory.h" + +#include "Messenger.h" + +EXTERN_C const GUID DECLSPEC_SELECTANY CLSID_Messenger + = { 0x8885370D, 0xB33E, 0x44b7, { 0x87, 0x5D, 0x28, 0xE4, 0x03, 0xCF, 0x92, 0x70 } }; + +STDMETHODIMP +MessengerClassFactory::CreateInstance(LPUNKNOWN outer, REFIID iid, PVOID *obj) +{ + HRESULT hr; + + if (outer) + { + *obj = NULL; + hr = CLASS_E_NOAGGREGATION; + } + else + { + IMessenger *messenger; + + if (_messenger) + { + hr = _messenger->Resolve(IID_IMessenger, (PVOID *) &messenger); + if (FAILED(hr) && (E_NOINTERFACE != hr)) + { + _messenger->Release(); + _messenger = NULL; + } + } + else + messenger = NULL; + if (!messenger) + { + messenger = new Messenger(); + + IWeakReferenceSource *weakReferenceSource; + + hr + = messenger->QueryInterface( + IID_IWeakReferenceSource, + (PVOID *) &weakReferenceSource); + if (SUCCEEDED(hr)) + { + IWeakReference *weakReference; + + hr = weakReferenceSource->GetWeakReference(&weakReference); + if (SUCCEEDED(hr)) + { + if (_messenger) + _messenger->Release(); + _messenger = weakReference; + } + } + } + hr = messenger->QueryInterface(iid, obj); + messenger->Release(); + } + return hr; +} diff --git a/src/native/windows/msofficecomm/MessengerClassFactory.h b/src/native/windows/msofficecomm/MessengerClassFactory.h new file mode 100644 index 0000000..52c1a2b --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerClassFactory.h @@ -0,0 +1,39 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_MESSENGERCLASSFACTORY_H_ +#define _JMSOFFICECOMM_MESSENGERCLASSFACTORY_H_ + +#include "ClassFactory.h" +#include <msgrua.h> + +/** + * Implements the <tt>IClassFactory</tt> interface for the <tt>IMessenger</tt> + * interface implementation. + * + * @author Lyubomir Marinov + */ +class MessengerClassFactory + : public ClassFactory +{ +public: + MessengerClassFactory() + : ClassFactory(CLSID_Messenger), _messenger(NULL) {} + + STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, PVOID *); + +protected: + virtual ~MessengerClassFactory() + { + if (_messenger) + _messenger->Release(); + } + +private: + IWeakReference *_messenger; +}; + +#endif /* _JMSOFFICECOMM_MESSENGERCLASSFACTORY_H_ */ diff --git a/src/native/windows/msofficecomm/MessengerContact.cxx b/src/native/windows/msofficecomm/MessengerContact.cxx new file mode 100644 index 0000000..73e9a2f --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerContact.cxx @@ -0,0 +1,460 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "MessengerContact.h" + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessengerContact + = { 0xE7479A0F, 0xBB19, 0x44a5, { 0x96, 0x8F, 0x6F, 0x41, 0xD9, 0x3E, 0xE0, 0xBC } }; + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessengerContactAdvanced + = { 0x086F69C0, 0x2FBD, 0x46b3, { 0xBE, 0x50, 0xEC, 0x40, 0x1A, 0xB8, 0x60, 0x99 } }; + +jclass MessengerContact::_jclass = NULL; +jmethodID MessengerContact::_jctorMethodID = NULL; +jmethodID MessengerContact::_jgetStatusMethodID = NULL; +jmethodID MessengerContact::_jisSelfMethodID = NULL; + +MessengerContact::MessengerContact(IMessenger *messenger, LPCOLESTR signinName) + : _messenger(messenger), + _jobject(NULL) +{ + _messenger->AddRef(); + if (signinName) + { + _signinName = ::_wcsdup(signinName); + constructJobject(_signinName); + } + else + _signinName = NULL; +} + +MessengerContact::~MessengerContact() +{ + if (_jobject) + destructJobject(); + _messenger->Release(); + if (_signinName) + ::free(_signinName); +} + +HRESULT MessengerContact::constructJobject(LPCOLESTR signinName) +{ + HRESULT hr; + + if (signinName) + { + JavaVM *vm = OutOfProcessServer::getJavaVM(); + JNIEnv *env; + + if (vm && !(vm->AttachCurrentThreadAsDaemon((void **) &env, NULL))) + { + jstring jsigninName + = env->NewString( + (const jchar *) signinName, + ::wcslen(signinName)); + + if (jsigninName) + { + jobject o = env->NewObject(_jclass, _jctorMethodID, jsigninName); + + if (o) + { + o = env->NewGlobalRef(o); + if (o) + { + if (_jobject) + env->DeleteGlobalRef(_jobject); + _jobject = o; + hr = S_OK; + } + else + hr = E_OUTOFMEMORY; + } + else + hr = E_FAIL; + } + else + hr = E_OUTOFMEMORY; + + /* + * The constructJobject(LPCOLESTR) method is called as part of the + * MessengerContact constructor which does not return an error code + * so any Java exception should be cleared in order to prevent + * unexpected behavior on the side of the Java VM. + */ + if (FAILED(hr)) + env->ExceptionClear(); + } + else + hr = E_UNEXPECTED; + } + else + hr = E_INVALIDARG; + return hr; +} + +HRESULT MessengerContact::destructJobject() +{ + JavaVM *vm = OutOfProcessServer::getJavaVM(); + JNIEnv *env; + HRESULT hr; + + if (vm && !(vm->AttachCurrentThreadAsDaemon((void **) &env, NULL))) + { + env->DeleteGlobalRef(_jobject); + _jobject = NULL; + hr = S_OK; + } + else + hr = E_UNEXPECTED; + return hr; +} + +STDMETHODIMP MessengerContact::get_Blocked(VARIANT_BOOL *pBoolBlock) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::get_CanPage(VARIANT_BOOL *pBoolPage) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::get_FriendlyName(BSTR *pbstrFriendlyName) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::get_IsSelf(VARIANT_BOOL *pBoolSelf) +{ + HRESULT hr; + + if (pBoolSelf) + { + if (_jobject) + { + JavaVM *vm = OutOfProcessServer::getJavaVM(); + JNIEnv *env; + + if (vm && !(vm->AttachCurrentThreadAsDaemon((void **) &env, NULL))) + { + jboolean jself + = env->CallBooleanMethod(_jobject, _jisSelfMethodID); + + if (env->ExceptionCheck()) + { + env->ExceptionClear(); + hr = E_FAIL; + } + else + { + *pBoolSelf + = (JNI_TRUE == jself) ? VARIANT_TRUE : VARIANT_FALSE; + hr = S_OK; + } + } + else + hr = E_UNEXPECTED; + } + else + hr = E_FAIL; + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} + +STDMETHODIMP MessengerContact::get_IsTagged(VARIANT_BOOL *pBoolIsTagged) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::get_PhoneNumber(MPHONE_TYPE PhoneType, BSTR *bstrNumber) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP +MessengerContact::get_PresenceProperties(VARIANT *pvPresenceProperties) +{ + HRESULT hr; + + if (pvPresenceProperties) + { + MISTATUS status; + + hr = get_Status(&status); + if (SUCCEEDED(hr)) + { + hr + = (VT_EMPTY == pvPresenceProperties->vt) + ? S_OK + : (::VariantClear(pvPresenceProperties)); + if (SUCCEEDED(hr)) + { + SAFEARRAY *sa + = ::SafeArrayCreateVector(VT_VARIANT, 0, PRESENCE_PROP_MAX); + + if (sa) + { + LONG i; + VARIANT v; + + i = PRESENCE_PROP_MSTATE; + ::VariantInit(&v); + v.vt = VT_I4; + v.lVal = status; + hr = ::SafeArrayPutElement(sa, &i, &v); + if (SUCCEEDED(hr)) + { + LONG availability; + + switch (status) + { + case MISTATUS_AWAY: + availability = 15000; + break; + case MISTATUS_BE_RIGHT_BACK: + availability = 12000; + break; + case MISTATUS_BUSY: + availability = 6000; + break; + case MISTATUS_DO_NOT_DISTURB: + availability = 9000; + break; + case MISTATUS_INVISIBLE: + availability = 18000; + break; + case MISTATUS_ONLINE: + availability = 3000; + break; + default: + availability = 0; + break; + } + if (availability) + { + i = PRESENCE_PROP_AVAILABILITY; + v.lVal = availability; + hr = ::SafeArrayPutElement(sa, &i, &v); + } + } + if (SUCCEEDED(hr)) + { + pvPresenceProperties->vt = VT_ARRAY; + pvPresenceProperties->parray = sa; + } + else + ::SafeArrayDestroy(sa); + } + else + hr = E_FAIL; + } + } + } + else + hr = E_INVALIDARG; + return hr; +} + +STDMETHODIMP MessengerContact::get_Property(MCONTACTPROPERTY ePropType, VARIANT *pvPropVal) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::get_ServiceId(BSTR *pbstrServiceID) +{ + return _messenger->get_MyServiceId(pbstrServiceID); +} + +STDMETHODIMP MessengerContact::get_ServiceName(BSTR *pbstrServiceName) +{ + return _messenger->get_MyServiceName(pbstrServiceName); +} + +STDMETHODIMP MessengerContact::get_SigninName(BSTR *pbstrSigninName) +{ + HRESULT hr; + + if (pbstrSigninName) + { + if (_signinName) + { + hr + = ((*pbstrSigninName = ::SysAllocString(_signinName))) + ? S_OK + : E_OUTOFMEMORY; + } + else + { + *pbstrSigninName = NULL; + hr = E_FAIL; + } + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} + +STDMETHODIMP MessengerContact::get_Status(MISTATUS *pMstate) +{ + HRESULT hr; + + if (pMstate) + { + if (_jobject) + { + JavaVM *vm = OutOfProcessServer::getJavaVM(); + JNIEnv *env; + + if (vm && !(vm->AttachCurrentThreadAsDaemon((void **) &env, NULL))) + { + jint jstatus + = env->CallIntMethod(_jobject, _jgetStatusMethodID); + + if (env->ExceptionCheck()) + { + env->ExceptionClear(); + hr = E_FAIL; + } + else + { + *pMstate = (MISTATUS) jstatus; + hr = S_OK; + } + } + else + hr = E_UNEXPECTED; + } + else + hr = E_FAIL; + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} + +STDMETHODIMP MessengerContact::put_Blocked(VARIANT_BOOL pBoolBlock) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::put_IsTagged(VARIANT_BOOL pBoolIsTagged) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::put_PresenceProperties(VARIANT vPresenceProperties) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::put_Property(MCONTACTPROPERTY ePropType, VARIANT vPropVal) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContact::QueryInterface(REFIID iid, PVOID *obj) +{ + HRESULT hr; + + if (obj) + { + if (IID_IMessengerContact == iid) + { + AddRef(); + *obj = static_cast<IMessengerContact *>(this); + hr = S_OK; + } + else + hr = DispatchImpl::QueryInterface(iid, obj); + } + else + hr = E_POINTER; + return hr; +} + +BOOL MessengerContact::signinNameEquals(LPDISPATCH contact, BSTR signinName) +{ + IMessengerContact *iMessengerContact; + HRESULT hr + = contact->QueryInterface( + IID_IMessengerContact, + (PVOID *) &iMessengerContact); + BOOL b; + + if (SUCCEEDED(hr)) + { + BSTR contactSigninName; + + hr = iMessengerContact->get_SigninName(&contactSigninName); + iMessengerContact->Release(); + if (SUCCEEDED(hr)) + { + b + = (VARCMP_EQ + == ::VarBstrCmp(contactSigninName, signinName, 0, 0)); + ::SysFreeString(contactSigninName); + } + else + b = FALSE; + } + else + b = FALSE; + return b; +} + +HRESULT MessengerContact::start(JNIEnv *env) +{ + LPSTR className = OutOfProcessServer::getClassName("MessengerContact"); + HRESULT hr; + + if (className) + { + jclass clazz = env->FindClass(className); + + ::free(className); + + if (clazz) + { + jmethodID ctorMethodID + = env->GetMethodID(clazz, "<init>", "(Ljava/lang/String;)V"); + + if (ctorMethodID) + { + jmethodID getStatusMethodID + = env->GetMethodID(clazz, "getStatus", "()I"); + + if (getStatusMethodID) + { + jmethodID isSelfMethodID + = env->GetMethodID(clazz, "isSelf", "()Z"); + + if (isSelfMethodID) + { + clazz = (jclass) env->NewGlobalRef(clazz); + if (clazz) + { + _jclass = clazz; + _jctorMethodID = ctorMethodID; + _jgetStatusMethodID = getStatusMethodID; + _jisSelfMethodID = isSelfMethodID; + hr = S_OK; + } + else + hr = E_OUTOFMEMORY; + } + else + hr = E_FAIL; + } + else + hr = E_FAIL; + } + else + hr = E_FAIL; + } + else + hr = E_FAIL; + } + else + hr = E_OUTOFMEMORY; + return hr; +} + +HRESULT MessengerContact::stop(JNIEnv *env) +{ + jclass clazz = _jclass; + + _jclass = NULL; + _jctorMethodID = NULL; + _jgetStatusMethodID = NULL; + _jisSelfMethodID = NULL; + if (clazz) + env->DeleteGlobalRef(clazz); + + return S_OK; +} diff --git a/src/native/windows/msofficecomm/MessengerContact.h b/src/native/windows/msofficecomm/MessengerContact.h new file mode 100644 index 0000000..3415bde --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerContact.h @@ -0,0 +1,70 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_MESSENGERCONTACT_H_ +#define _JMSOFFICECOMM_MESSENGERCONTACT_H_ + +#include "DispatchImpl.h" +#include <msgrua.h> + +/** + * Implements the <tt>IMessengerContact</tt> interface. + * + * @author Lyubomir Marinov + */ +class MessengerContact + : public DispatchImpl<IMessengerContactAdvanced, IID_IMessengerContactAdvanced> +{ +public: + static HRESULT start(JNIEnv *env); + static HRESULT stop(JNIEnv *env); + + MessengerContact(IMessenger *messenger, LPCOLESTR signinName); + + // IUnknown + STDMETHODIMP QueryInterface(REFIID, PVOID *); + + // IMessengerContact + STDMETHODIMP get_FriendlyName(BSTR *pbstrFriendlyName); + STDMETHODIMP get_Status(MISTATUS *pMstate); + STDMETHODIMP get_SigninName(BSTR *pbstrSigninName); + STDMETHODIMP get_ServiceName(BSTR *pbstrServiceName); + STDMETHODIMP get_Blocked(VARIANT_BOOL *pBoolBlock); + STDMETHODIMP put_Blocked(VARIANT_BOOL pBoolBlock); + STDMETHODIMP get_CanPage(VARIANT_BOOL *pBoolPage); + STDMETHODIMP get_PhoneNumber(MPHONE_TYPE PhoneType, BSTR *bstrNumber); + STDMETHODIMP get_IsSelf(VARIANT_BOOL *pBoolSelf); + STDMETHODIMP get_Property(MCONTACTPROPERTY ePropType, VARIANT *pvPropVal); + STDMETHODIMP put_Property(MCONTACTPROPERTY ePropType, VARIANT vPropVal); + STDMETHODIMP get_ServiceId(BSTR *pbstrServiceID); + + // IMessengerContactAdvanced + STDMETHODIMP get_IsTagged(VARIANT_BOOL *pBoolIsTagged); + STDMETHODIMP put_IsTagged(VARIANT_BOOL pBoolIsTagged); + STDMETHODIMP get_PresenceProperties(VARIANT *pvPresenceProperties); + STDMETHODIMP put_PresenceProperties(VARIANT vPresenceProperties); + + static BOOL signinNameEquals(LPDISPATCH contact, BSTR signinName); + +protected: + virtual ~MessengerContact(); + + IMessenger *_messenger; + +private: + static jclass _jclass; + static jmethodID _jctorMethodID; + static jmethodID _jgetStatusMethodID; + static jmethodID _jisSelfMethodID; + + HRESULT constructJobject(LPCOLESTR signinName); + HRESULT destructJobject(); + + jobject _jobject; + LPOLESTR _signinName; +}; + +#endif /* #ifndef _JMSOFFICECOMM_MESSENGERCONTACT_H_ */ diff --git a/src/native/windows/msofficecomm/MessengerContacts.cxx b/src/native/windows/msofficecomm/MessengerContacts.cxx new file mode 100644 index 0000000..50544c8 --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerContacts.cxx @@ -0,0 +1,116 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "MessengerContacts.h" + +#include "MessengerContact.h" + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessengerContacts + = { 0xE7479A0D, 0xBB19, 0x44a5, { 0x96, 0x8F, 0x6F, 0x41, 0xD9, 0x3E, 0xE0, 0xBC } }; + +class SelfMessengerContact + : public MessengerContact +{ +public: + SelfMessengerContact(IMessenger *messenger) + : MessengerContact(messenger, NULL) {} + + // IMessengerContact + STDMETHODIMP get_IsSelf(VARIANT_BOOL *pBoolSelf) + { + HRESULT hr; + + if (pBoolSelf) + { + *pBoolSelf = VARIANT_TRUE; + hr = S_OK; + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; + } + + STDMETHODIMP get_SigninName(BSTR *pbstrSigninName) + { return _messenger->get_MySigninName(pbstrSigninName); } + + STDMETHODIMP get_Status(MISTATUS *pMstate) + { + HRESULT hr; + + if (pMstate) + { + *pMstate = MISTATUS_ONLINE; + hr = S_OK; + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; + } + +protected: + virtual ~SelfMessengerContact() {} +}; + +MessengerContacts::MessengerContacts(IMessenger *messenger) + : _messenger(messenger), + _self(NULL) +{ + _messenger->AddRef(); +} + +MessengerContacts::~MessengerContacts() +{ + _messenger->Release(); + if (_self) + _self->Release(); +} + +STDMETHODIMP MessengerContacts::get__NewEnum(IUnknown **ppUnknown) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerContacts::get_Count(LONG *pcContacts) +{ + HRESULT hr; + + if (pcContacts) + { + *pcContacts = 1; + hr = S_OK; + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} + +STDMETHODIMP MessengerContacts::getSelf(IDispatch **ppMContact) + STDMETHODIMP_RESOLVE_WEAKREFERENCE_OR_NEW(ppMContact,_self,SelfMessengerContact,_messenger) + +STDMETHODIMP MessengerContacts::Item(LONG Index, IDispatch **ppMContact) +{ + HRESULT hr; + + if (ppMContact) + { + if (0 > Index) + { + *ppMContact = NULL; + hr = E_INVALIDARG; + } + else if (0 == Index) + hr = getSelf(ppMContact); + else + { + *ppMContact = NULL; + hr = E_FAIL; + } + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} + +STDMETHODIMP MessengerContacts::Remove(IDispatch *pMContact) + STDMETHODIMP_E_NOTIMPL_STUB diff --git a/src/native/windows/msofficecomm/MessengerContacts.h b/src/native/windows/msofficecomm/MessengerContacts.h new file mode 100644 index 0000000..8e81dc2 --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerContacts.h @@ -0,0 +1,40 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_MESSENGERCONTACTS_H_ +#define _JMSOFFICECOMM_MESSENGERCONTACTS_H_ + +#include "DispatchImpl.h" +#include <msgrua.h> + +/** + * Implements the <tt>IMessengerContacts</tt> interface. + * + * @author Lyubomir Marinov + */ +class MessengerContacts + : public DispatchImpl<IMessengerContacts, IID_IMessengerContacts> +{ +public: + MessengerContacts(IMessenger *messenger); + + // IMessengerContacts + STDMETHODIMP get_Count(LONG *pcContacts); + STDMETHODIMP Item(LONG Index, IDispatch **ppMContact); + STDMETHODIMP Remove(IDispatch *pMContact); + STDMETHODIMP get__NewEnum(IUnknown **ppUnknown); + +protected: + virtual ~MessengerContacts(); + +private: + STDMETHODIMP getSelf(IDispatch **ppMContact); + + IMessenger *_messenger; + IWeakReference *_self; +}; + +#endif /* #ifndef _JMSOFFICECOMM_MESSENGERCONTACTS_H_ */ diff --git a/src/native/windows/msofficecomm/MessengerService.cxx b/src/native/windows/msofficecomm/MessengerService.cxx new file mode 100644 index 0000000..b02f62e --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerService.cxx @@ -0,0 +1,52 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "MessengerService.h" + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessengerService + = { 0x2E50547C, 0xA8AA, 0x4f60, { 0xB5, 0x7E, 0x1F, 0x41, 0x47, 0x11, 0x00, 0x7B } }; + +MessengerService::MessengerService(IMessenger *messenger) + : _messenger(messenger) +{ + _messenger->AddRef(); +} + +MessengerService::~MessengerService() +{ + _messenger->Release(); +} + +STDMETHODIMP MessengerService::get_MyFriendlyName(BSTR *pbstrName) +{ + return _messenger->get_MyFriendlyName(pbstrName); +} + +STDMETHODIMP MessengerService::get_MySigninName(BSTR *pbstrName) +{ + return _messenger->get_MySigninName(pbstrName); +} + +STDMETHODIMP MessengerService::get_MyStatus(MISTATUS *pmiStatus) +{ + return _messenger->get_MyStatus(pmiStatus); +} + +STDMETHODIMP MessengerService::get_Property(MSERVICEPROPERTY ePropType, VARIANT *pvPropVal) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerService::get_ServiceID(BSTR *pbstrID) +{ + return _messenger->get_MyServiceId(pbstrID); +} + +STDMETHODIMP MessengerService::get_ServiceName(BSTR *pbstrServiceName) +{ + return _messenger->get_MyServiceName(pbstrServiceName); +} + +STDMETHODIMP MessengerService::put_Property(MSERVICEPROPERTY ePropType, VARIANT vPropVal) + STDMETHODIMP_E_NOTIMPL_STUB diff --git a/src/native/windows/msofficecomm/MessengerService.h b/src/native/windows/msofficecomm/MessengerService.h new file mode 100644 index 0000000..4747fca --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerService.h @@ -0,0 +1,35 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_MESSENGERSERVICE_H_ +#define _JMSOFFICECOMM_MESSENGERSERVICE_H_ + +#include "DispatchImpl.h" +#include <msgrua.h> + +class MessengerService + : public DispatchImpl<IMessengerService, IID_IMessengerService> +{ +public: + MessengerService(IMessenger *messenger); + + // IMessengerService + STDMETHODIMP get_ServiceName(BSTR *pbstrServiceName); + STDMETHODIMP get_ServiceID(BSTR *pbstrID); + STDMETHODIMP get_MyFriendlyName(BSTR *pbstrName); + STDMETHODIMP get_MyStatus(MISTATUS *pmiStatus); + STDMETHODIMP get_MySigninName(BSTR *pbstrName); + STDMETHODIMP get_Property(MSERVICEPROPERTY ePropType, VARIANT *pvPropVal); + STDMETHODIMP put_Property(MSERVICEPROPERTY ePropType, VARIANT vPropVal); + +protected: + virtual ~MessengerService(); + +private: + IMessenger *_messenger; +}; + +#endif /* #ifndef _JMSOFFICECOMM_MESSENGERSERVICE_H_ */ diff --git a/src/native/windows/msofficecomm/MessengerServices.cxx b/src/native/windows/msofficecomm/MessengerServices.cxx new file mode 100644 index 0000000..ffd879c --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerServices.cxx @@ -0,0 +1,70 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "MessengerServices.h" + +#include "MessengerService.h" + +EXTERN_C const GUID DECLSPEC_SELECTANY IID_IMessengerServices + = { 0x2E50547B, 0xA8AA, 0x4f60, { 0xB5, 0x7E, 0x1F, 0x41, 0x47, 0x11, 0x00, 0x7B } }; + +MessengerServices::MessengerServices(IMessenger *messenger) + : _messenger(messenger), + _primaryService(NULL) +{ + _messenger->AddRef(); +} + +MessengerServices::~MessengerServices() +{ + _messenger->Release(); + if (_primaryService) + _primaryService->Release(); +} + +STDMETHODIMP MessengerServices::get__NewEnum(IUnknown **ppUnknown) + STDMETHODIMP_E_NOTIMPL_STUB + +STDMETHODIMP MessengerServices::get_Count(long *pcServices) +{ + HRESULT hr; + + if (pcServices) + { + *pcServices = 1; + hr = S_OK; + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} + +STDMETHODIMP MessengerServices::get_PrimaryService(IDispatch **ppService) + STDMETHODIMP_RESOLVE_WEAKREFERENCE_OR_NEW(ppService,_primaryService,MessengerService,_messenger) + +STDMETHODIMP MessengerServices::Item(long Index, IDispatch **ppService) +{ + HRESULT hr; + + if (ppService) + { + if (0 > Index) + { + *ppService = NULL; + hr = E_INVALIDARG; + } + else if (0 == Index) + hr = get_PrimaryService(ppService); + else + { + *ppService = NULL; + hr = E_FAIL; + } + } + else + hr = RPC_X_NULL_REF_POINTER; + return hr; +} diff --git a/src/native/windows/msofficecomm/MessengerServices.h b/src/native/windows/msofficecomm/MessengerServices.h new file mode 100644 index 0000000..3422e0e --- /dev/null +++ b/src/native/windows/msofficecomm/MessengerServices.h @@ -0,0 +1,33 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_MESSENGERSERVICES_H_ +#define _JMSOFFICECOMM_MESSENGERSERVICES_H_ + +#include "DispatchImpl.h" +#include <msgrua.h> + +class MessengerServices + : public DispatchImpl<IMessengerServices, IID_IMessengerServices> +{ +public: + MessengerServices(IMessenger *messenger); + + // IMessengerServices + STDMETHODIMP get_PrimaryService(IDispatch **ppService); + STDMETHODIMP get_Count(long *pcServices); + STDMETHODIMP Item(long Index, IDispatch **ppService); + STDMETHODIMP get__NewEnum(IUnknown **ppUnknown); + +protected: + virtual ~MessengerServices(); + +private: + IMessenger *_messenger; + IWeakReference *_primaryService; +}; + +#endif /* _JMSOFFICECOMM_MESSENGERSERVICES_H_ */ diff --git a/src/native/windows/msofficecomm/OutOfProcessServer.cxx b/src/native/windows/msofficecomm/OutOfProcessServer.cxx new file mode 100644 index 0000000..1ca3974 --- /dev/null +++ b/src/native/windows/msofficecomm/OutOfProcessServer.cxx @@ -0,0 +1,628 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "OutOfProcessServer.h" + +#include "Log.h" +#include "Messenger.h" +#include "MessengerClassFactory.h" +#include "MessengerContact.h" +#include "net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer.h" +#include "process.h" + +EXTERN_C const GUID DECLSPEC_SELECTANY LIBID_CommunicatorUA + = { 0x2B317E1D, 0x50E5, 0x4f5e, { 0xA3, 0xA4, 0xFB, 0x85, 0x20, 0x6E, 0xDA, 0x48 } }; + +JNIEXPORT jint JNICALL +Java_net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer_start + (JNIEnv *env, jclass clazz) +{ + LPSTR functionName = ::strdup(__FUNCTION__); + LPSTR packageName; + + if (functionName) + { + packageName = functionName + 5 /* Java_ */; + + size_t packageNameLength + = ::strlen(packageName) - 24 /* OutOfProcessServer_start */; + + packageName[packageNameLength] = '\0'; + + char ch; + LPSTR str = packageName; + + while ((ch = *str)) + { + if ('_' == ch) + *str = '/'; + str++; + } + } + else + packageName = NULL; + + jint ret = OutOfProcessServer::start(env, clazz, packageName); + + if (functionName) + ::free(functionName); + + return ret; +} + +JNIEXPORT jint JNICALL +Java_net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer_stop + (JNIEnv *env, jclass clazz) +{ + return OutOfProcessServer::stop(env, clazz); +} + +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) +{ + return OutOfProcessServer::JNI_OnLoad(vm); +} + +JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) +{ + OutOfProcessServer::JNI_OnUnload(vm); +} + +CRITICAL_SECTION OutOfProcessServer::_criticalSection; +ITypeLib * OutOfProcessServer::_iTypeLib; +ClassFactory * OutOfProcessServer::_messengerClassFactory = NULL; +LPSTR OutOfProcessServer::_packageName; +HANDLE OutOfProcessServer::_threadHandle; +DWORD OutOfProcessServer::_threadId; +JavaVM * OutOfProcessServer::_vm = NULL; + +LPSTR OutOfProcessServer::getClassName(LPCSTR className) +{ + size_t packageNameLength = _packageName ? ::strlen(_packageName) : 0; + size_t classNameLength = ::strlen(className); + LPSTR ret = (LPSTR) ::malloc(packageNameLength + classNameLength + 1); + + if (ret) + { + LPSTR str = ret; + + if (packageNameLength) + { + ::memcpy(str, _packageName, packageNameLength); + str += packageNameLength; + } + if (classNameLength) + { + ::memcpy(str, className, classNameLength); + str += classNameLength; + } + *str = '\0'; + } + return ret; +} + +BOOL OutOfProcessServer::isMicrosoftOfficeOutlookCallIntegrationIMApplication() +{ + TCHAR path[MAX_PATH + 1]; + DWORD pathCapacity = sizeof(path) / sizeof(TCHAR); + DWORD pathLength = ::GetModuleFileName(NULL, path, pathCapacity); + BOOL b; + + if (pathLength && (pathLength < pathCapacity)) + { + LPTSTR fileName = NULL; + + for (LPTSTR str = path + (pathLength - 1); str != path; str--) + { + TCHAR ch = *str; + + if (('\\' == ch) || ('/' == ch)) + { + fileName = str + 1; + break; + } + } + if (fileName && *fileName) + { + DWORD dataSize = (pathLength + 2) * sizeof(TCHAR); + LPBYTE data = (LPBYTE) ::malloc(dataSize); + + if (data) + { + SYSTEM_INFO systemInfo; + REGSAM alternatives86[] = { 0 }; + REGSAM alternatives64[] = { KEY_WOW64_32KEY, KEY_WOW64_64KEY }; + REGSAM *alternatives; + size_t alternativeCount; + + ::GetNativeSystemInfo(&systemInfo); + if (PROCESSOR_ARCHITECTURE_INTEL + == systemInfo.wProcessorArchitecture) + { + alternatives = alternatives86; + alternativeCount = sizeof(alternatives86) / sizeof(REGSAM); + } + else + { + alternatives = alternatives64; + alternativeCount = sizeof(alternatives64) / sizeof(REGSAM); + } + + LPCTSTR key + = _T("SOFTWARE\\Microsoft\\Office\\Outlook\\Call Integration"); + LPCTSTR valueName = _T("IMApplication"); + size_t fileNameLength = ::_tcslen(fileName); + + b = FALSE; + for (size_t i = 0; i < alternativeCount; i++) + { + HKEY hkey; + + if (::RegOpenKeyEx( + HKEY_LOCAL_MACHINE, + key, + 0, + KEY_QUERY_VALUE | alternatives[i], + &hkey) + == ERROR_SUCCESS) + { + DWORD type; + + dataSize = (pathLength + 1) * sizeof(TCHAR); + ::ZeroMemory(data, dataSize + sizeof(TCHAR)); + if ((::RegQueryValueEx( + hkey, + valueName, + NULL, + &type, + data, + &dataSize) + == ERROR_SUCCESS) + && (REG_SZ == type)) + { + b + = (::_tcsnicmp( + fileName, + (LPCTSTR) data, + fileNameLength) + == 0); + } + ::RegCloseKey(hkey); + + if (b) + break; + } + } + ::free(data); + } + else + b = FALSE; + } + else + b = FALSE; + } + else + b = FALSE; + return b; +} + +jint OutOfProcessServer::JNI_OnLoad(JavaVM *vm) +{ + jint version; + + if (isMicrosoftOfficeOutlookCallIntegrationIMApplication()) + { + ::InitializeCriticalSection(&_criticalSection); + _vm = vm; + version = JNI_VERSION_1_4; + } + else + version = JNI_ERR; + return version; +} + +HRESULT OutOfProcessServer::loadRegTypeLib() +{ + ITypeLib *iTypeLib; + HRESULT hr = ::LoadRegTypeLib(LIBID_CommunicatorUA, 1, 0, 0, &iTypeLib); + + if (SUCCEEDED(hr)) + _iTypeLib = iTypeLib; + else + { + HMODULE module; + + if (::GetModuleHandleEx( + GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS + | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + (LPCTSTR) (OutOfProcessServer::loadRegTypeLib), + &module)) + { + WCHAR path[MAX_PATH + 1]; + DWORD pathCapacity = sizeof(path) / sizeof(WCHAR); + DWORD pathLength = ::GetModuleFileNameW(module, path, pathCapacity); + + if (pathLength && (pathLength < pathCapacity)) + { + hr = ::LoadTypeLibEx(path, REGKIND_NONE, &iTypeLib); + if (SUCCEEDED(hr)) + { + HMODULE oleaut32 = ::GetModuleHandle(_T("oleaut32.dll")); + + if (oleaut32) + { + typedef HRESULT (*RTLFU)(LPTYPELIB,LPOLESTR,LPOLESTR); + RTLFU registerTypeLibForUser + = (RTLFU) + ::GetProcAddress( + oleaut32, + "RegisterTypeLibForUser"); + + if (registerTypeLibForUser) + { + hr = registerTypeLibForUser(iTypeLib, path, NULL); + if (SUCCEEDED(hr)) + _iTypeLib = iTypeLib; + } + else + hr = E_UNEXPECTED; + } + else + hr = E_UNEXPECTED; + } + } + } + if (_iTypeLib != iTypeLib) + iTypeLib->Release(); + } + return hr; +} + +DWORD +OutOfProcessServer::regCreateKeyAndSetValue + (LPCTSTR key, LPCTSTR valueName, DWORD data) +{ + SYSTEM_INFO systemInfo; + REGSAM alternatives86[] = { 0 }; + REGSAM alternatives64[] = { KEY_WOW64_32KEY, KEY_WOW64_64KEY }; + REGSAM *alternatives; + size_t alternativeCount; + + ::GetNativeSystemInfo(&systemInfo); + if (PROCESSOR_ARCHITECTURE_INTEL == systemInfo.wProcessorArchitecture) + { + alternatives = alternatives86; + alternativeCount = sizeof(alternatives86) / sizeof(REGSAM); + } + else + { + alternatives = alternatives64; + alternativeCount = sizeof(alternatives64) / sizeof(REGSAM); + } + + DWORD lastError; + + for (size_t i = 0; i < alternativeCount; i++) + { + HKEY hkey; + + lastError + = ::RegCreateKeyEx( + HKEY_CURRENT_USER, + key, + 0, + NULL, + REG_OPTION_VOLATILE, + KEY_SET_VALUE | alternatives[i], + NULL, + &hkey, + NULL); + if (ERROR_SUCCESS == lastError) + { + lastError + = ::RegSetValueEx( + hkey, + valueName, + 0, + REG_DWORD, + (const BYTE *) &data, + sizeof(data)); + ::RegCloseKey(hkey); + } + if (ERROR_SUCCESS != lastError) + break; + } + return lastError; +} + +HRESULT OutOfProcessServer::registerClassObjects() +{ + ClassFactory *classObject = new MessengerClassFactory(); + HRESULT hresult = classObject->registerClassObject(); + + if (SUCCEEDED(hresult)) + _messengerClassFactory = classObject; + else + classObject->Release(); + + if (SUCCEEDED(hresult)) + { + hresult = ::CoResumeClassObjects(); + if (FAILED(hresult)) + revokeClassObjects(); + } + + return hresult; +} + +ULONG OutOfProcessServer::releaseTypeLib() +{ + // TODO UnRegisterTypeLibForUser + return _iTypeLib->Release(); +} + +HRESULT OutOfProcessServer::revokeClassObjects() +{ + HRESULT ret = ::CoSuspendClassObjects(); + + if (SUCCEEDED(ret)) + { + ClassFactory *classObject = _messengerClassFactory; + + if (classObject) + { + _messengerClassFactory = NULL; + + HRESULT hr = classObject->revokeClassObject(); + + classObject->Release(); + if (FAILED(hr)) + ret = hr; + } + } + return ret; +} + +unsigned __stdcall OutOfProcessServer::run(void *) +{ + Log::open(); + + HRESULT hr = ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + unsigned ret = 0; + + if (SUCCEEDED(hr)) + { + hr = loadRegTypeLib(); + if (SUCCEEDED(hr)) + { + if (ERROR_SUCCESS == setIMProvidersCommunicatorUpAndRunning(1)) + { + MSG msg; + + /* + * Create the message queue of this thread before any other part + * of the code (e.g. the release method) has a chance to invoke + * PostThreadMessage. + */ + ::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); + + hr = registerClassObjects(); + if (SUCCEEDED(hr)) + { + if (ERROR_SUCCESS + == setIMProvidersCommunicatorUpAndRunning(2)) + { + HANDLE threadHandle = _threadHandle; + BOOL logMsgWaitForMultipleObjectsExFailed = TRUE; + BOOL quit = FALSE; + + do + { + /* + * Enable the use of the QueueUserAPC function by + * entering an altertable state. + */ + if ((WAIT_FAILED + == ::MsgWaitForMultipleObjectsEx( + 1, + &threadHandle, + INFINITE, + QS_ALLINPUT | QS_ALLPOSTMESSAGE, + MWMO_ALERTABLE + | MWMO_INPUTAVAILABLE)) + && logMsgWaitForMultipleObjectsExFailed) + { + /* + * Logging the possible failures of the calls to + * MsgWaitForMultipleObjectsEx multiple times is + * unlikely to be useful. Besides, the call in + * question is performed inside the message loop + * and the logging will be an unnecessary + * performance penalty. + */ + logMsgWaitForMultipleObjectsExFailed = FALSE; + Log::d( + _T("OutOfProcessServer::run:") + _T(" MsgWaitForMultipleObjectsEx=WAIT_FAILED;") + _T("\n")); + } + while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + if (WM_QUIT == msg.message) + { + quit = TRUE; + ret = msg.wParam; + break; + } + else if (msg.hwnd) + { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + } + } + while (!quit); + } + + revokeClassObjects(); + } + } + + /* + * Even if setIMProvidersCommunicatorUpAndRunning(DWORD) failed, it + * may have successfully set some of the multiple related registry + * keys. + */ + setIMProvidersCommunicatorUpAndRunning(0); + + releaseTypeLib(); + } + + ::CoUninitialize(); + } + + Log::close(); + return ret; +} + +DWORD OutOfProcessServer::setIMProvidersCommunicatorUpAndRunning(DWORD dw) +{ + DWORD lastError; + + if (dw) + { + lastError + = regCreateKeyAndSetValue( + _T("Software\\Microsoft\\Office\\12.0\\Common\\PersonaMenu"), + _T("RTCApplication"), + 3); + } + else + lastError = ERROR_SUCCESS; + if (ERROR_SUCCESS == lastError) + { + lastError + = regCreateKeyAndSetValue( + _T("Software\\IM Providers\\Communicator"), + _T("UpAndRunning"), + dw); + } + return lastError; +} + +HRESULT OutOfProcessServer::start(JNIEnv *env, jclass clazz, LPCSTR packageName) +{ + HRESULT hr; + + if (packageName) + hr = ((_packageName = ::strdup(packageName))) ? S_OK : E_OUTOFMEMORY; + else + { + _packageName = NULL; + hr = S_OK; + } + + if (SUCCEEDED(hr)) + { + hr = Messenger::start(env); + if (SUCCEEDED(hr)) + { + hr = MessengerContact::start(env); + if (SUCCEEDED(hr)) + { + unsigned threadId; + HANDLE threadHandle + = (HANDLE) + ::_beginthreadex( + NULL, + 0, + OutOfProcessServer::run, + NULL, + CREATE_SUSPENDED, + &threadId); + + if (threadHandle) + { + enterCriticalSection(); + + _threadHandle = threadHandle; + _threadId = (DWORD) threadId; + if (((DWORD) -1) == ::ResumeThread(threadHandle)) + { + DWORD lastError = ::GetLastError(); + + _threadHandle = NULL; + + ::CloseHandle(threadHandle); + hr = HRESULT_FROM_WIN32(lastError); + } + + leaveCriticalSection(); + } + else + hr = E_UNEXPECTED; + + if (FAILED(hr)) + MessengerContact::stop(env); + } + + if (FAILED(hr)) + Messenger::stop(env); + } + + if (FAILED(hr) && _packageName) + { + ::free(_packageName); + _packageName = NULL; + } + } + + return hr; +} + +HRESULT OutOfProcessServer::stop(JNIEnv *env, jclass clazz) +{ + DWORD lastError; + + if (::PostThreadMessage(_threadId, WM_QUIT, 0, 0)) + { + do + { + DWORD exitCode; + + if (::GetExitCodeThread(_threadHandle, &exitCode)) + { + if (STILL_ACTIVE == exitCode) + { + if (WAIT_FAILED + == ::WaitForSingleObject(_threadHandle, INFINITE)) + break; + } + else + break; + } + else + break; + } + while (1); + + if (::CloseHandle(_threadHandle)) + lastError = 0; + else + lastError = ::GetLastError(); + + MessengerContact::stop(env); + Messenger::stop(env); + + if (_packageName) + { + ::free(_packageName); + _packageName = NULL; + } + } + else + lastError = ::GetLastError(); + return lastError ? HRESULT_FROM_WIN32(lastError) : S_OK; +} diff --git a/src/native/windows/msofficecomm/OutOfProcessServer.h b/src/native/windows/msofficecomm/OutOfProcessServer.h new file mode 100644 index 0000000..b069a72 --- /dev/null +++ b/src/native/windows/msofficecomm/OutOfProcessServer.h @@ -0,0 +1,64 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_OUTOFPROCESSSERVER_H_ +#define _JMSOFFICECOMM_OUTOFPROCESSSERVER_H_ + +#include <objbase.h> +#include <jni.h> +#include <windows.h> + +class ClassFactory; + +/** + * Implements the jmsoutlookcomm application which is an out-of-process local COM + * server. + * + * @author Lyubomir Marinov + */ +class OutOfProcessServer +{ +public: + static ULONG addRef() { /* TODO Auto-generated method stub */ return 0; } + static void enterCriticalSection() + { ::EnterCriticalSection(&_criticalSection); } + static LPSTR getClassName(LPCSTR className); + static JavaVM *getJavaVM() { return _vm; } + static HANDLE getThreadHandle() { return _threadHandle; } + static DWORD getThreadId() { return _threadId; } + static HRESULT getTypeInfo(UINT index, ITypeInfo **ppTInfo) + { return _iTypeLib->GetTypeInfo(index, ppTInfo); } + static UINT getTypeInfoCount() { return _iTypeLib->GetTypeInfoCount(); } + static HRESULT getTypeInfoOfGuid(REFGUID guid, ITypeInfo **ppTInfo) + { return _iTypeLib->GetTypeInfoOfGuid(guid, ppTInfo); } + static jint JNI_OnLoad(JavaVM *vm); + static void JNI_OnUnload(JavaVM *vm) { _vm = NULL; } + static void leaveCriticalSection() + { ::LeaveCriticalSection(&_criticalSection); } + static ULONG release() { /* TODO Auto-generated method stub */ return 0; } + static HRESULT start(JNIEnv *env, jclass clazz, LPCSTR packageName); + static HRESULT stop(JNIEnv *env, jclass clazz); + +private: + static BOOL isMicrosoftOfficeOutlookCallIntegrationIMApplication(); + static HRESULT loadRegTypeLib(); + static DWORD regCreateKeyAndSetValue(LPCTSTR key, LPCTSTR valueName, DWORD data); + static HRESULT registerClassObjects(); + static ULONG releaseTypeLib(); + static HRESULT revokeClassObjects(); + static unsigned __stdcall run(void *); + static DWORD setIMProvidersCommunicatorUpAndRunning(DWORD dw); + + static CRITICAL_SECTION _criticalSection; + static ITypeLib * _iTypeLib; + static ClassFactory * _messengerClassFactory; + static LPSTR _packageName; + static HANDLE _threadHandle; + static DWORD _threadId; + static JavaVM * _vm; +}; + +#endif /* #ifndef _JMSOFFICECOMM_OUTOFPROCESSSERVER_H_ */ diff --git a/src/native/windows/msofficecomm/Resources.h b/src/native/windows/msofficecomm/Resources.h new file mode 100644 index 0000000..d8f95d8 --- /dev/null +++ b/src/native/windows/msofficecomm/Resources.h @@ -0,0 +1,6 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ diff --git a/src/native/windows/msofficecomm/Resources.rc b/src/native/windows/msofficecomm/Resources.rc new file mode 100644 index 0000000..dbf4b62 --- /dev/null +++ b/src/native/windows/msofficecomm/Resources.rc @@ -0,0 +1,9 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "Resources.h" + +1 TYPELIB msgrua.tlb diff --git a/src/native/windows/msofficecomm/StringUtils.cxx b/src/native/windows/msofficecomm/StringUtils.cxx new file mode 100644 index 0000000..71beed0 --- /dev/null +++ b/src/native/windows/msofficecomm/StringUtils.cxx @@ -0,0 +1,54 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "StringUtils.h" + +LPWSTR StringUtils::MultiByteToWideChar(LPCSTR str) +{ + int wsize = ::MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + LPWSTR wstr; + + if (wsize) + { + wstr = (LPWSTR) ::malloc(wsize * sizeof(WCHAR)); + if (str && !::MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, wsize)) + { + ::free(wstr); + wstr = NULL; + } + } + else + wstr = NULL; + return wstr; +} + +LPSTR StringUtils::WideCharToMultiByte(LPCWSTR wstr) +{ + int size = ::WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); + LPSTR str; + + if (size) + { + str = (LPSTR) ::malloc(size); + if (str + && !::WideCharToMultiByte( + CP_ACP, + 0, + wstr, + -1, + str, + size, + NULL, + NULL)) + { + ::free(str); + str = NULL; + } + } + else + str = NULL; + return str; +} diff --git a/src/native/windows/msofficecomm/StringUtils.h b/src/native/windows/msofficecomm/StringUtils.h new file mode 100644 index 0000000..1c0eb18 --- /dev/null +++ b/src/native/windows/msofficecomm/StringUtils.h @@ -0,0 +1,20 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_STRINGUTILS_H_ +#define _JMSOFFICECOMM_STRINGUTILS_H_ + +#include <tchar.h> +#include <windows.h> + +class StringUtils +{ +public: + static LPWSTR MultiByteToWideChar(LPCSTR str); + static LPSTR WideCharToMultiByte(LPCWSTR wstr); +}; + +#endif /* #ifndef _JMSOFFICECOMM_STRINGUTILS_H_ */ diff --git a/src/native/windows/msofficecomm/UnknownImpl.h b/src/native/windows/msofficecomm/UnknownImpl.h new file mode 100644 index 0000000..dcd6607 --- /dev/null +++ b/src/native/windows/msofficecomm/UnknownImpl.h @@ -0,0 +1,129 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_UNKNOWNIMPL_H_ +#define _JMSOFFICECOMM_UNKNOWNIMPL_H_ + +#include "Log.h" +#include "OutOfProcessServer.h" +#include "StringUtils.h" +#include "WeakReferenceSource.h" + +#define STDMETHODIMP_E_NOTIMPL_STUB \ + { \ + Log::d(_T("%s\n"), __PRETTY_FUNCTION__); \ + return E_NOTIMPL; \ + } + +/** + * Represents a base implementation of the <tt>IUnknown</tt> interface. + * + * @author Lyubomir Marinov + */ +template <class T, REFIID IID_T> +class UnknownImpl + : public T +{ +public: + // IUnknown + STDMETHODIMP QueryInterface(REFIID iid, PVOID *obj) + { + HRESULT hr; + + if (!obj) + hr = E_POINTER; + else if (IID_IUnknown == iid) + { + AddRef(); + *obj = static_cast<LPUNKNOWN>(this); + hr = S_OK; + } + else if (IID_T == iid) + { + AddRef(); + *obj = static_cast<T *>(this); + hr = S_OK; + } + else if (IID_IWeakReferenceSource == iid) + { + if (!_weakReferenceSource) + _weakReferenceSource = new WeakReferenceSource(this); + _weakReferenceSource->AddRef(); + *obj = static_cast<IWeakReferenceSource *>(_weakReferenceSource); + hr = S_OK; + } + else + { + *obj = NULL; + hr = E_NOINTERFACE; + } + + if (FAILED(hr)) + { + LPOLESTR olestr; + + if (SUCCEEDED(::StringFromIID(iid, &olestr))) + { + LPTSTR tstr +#ifdef _UNICODE + = olestr; +#else + = StringUtils::WideCharToMultiByte(olestr); +#endif /* #ifdef _UNICODE */ + + if (tstr) + { + Log::d( + _T("UnknownImpl::QueryInterface: this=%p; iid=%s;\n"), + (PVOID) this, + tstr); + if (tstr != olestr) + ::free(tstr); + } + ::CoTaskMemFree(olestr); + } + } + + return hr; + } + + STDMETHODIMP_(ULONG) AddRef() { return ++_refCount; } + + STDMETHODIMP_(ULONG) Release() + { + ULONG refCount = --_refCount; + + if (!refCount) + delete this; + Log::d( + _T("UnknownImpl::Release: this=%p; refCount=%lu;\n"), + (PVOID) this, + refCount); + return refCount; + } + +protected: + UnknownImpl() + : _refCount(1), + _weakReferenceSource(NULL) + { + OutOfProcessServer::addRef(); + } + + virtual ~UnknownImpl() + { + if (_weakReferenceSource) + delete _weakReferenceSource; + + OutOfProcessServer::release(); + } + +private: + ULONG _refCount; + WeakReferenceSource *_weakReferenceSource; +}; + +#endif /* #ifndef _JMSOFFICECOMM_UNKNOWNIMPL_H_ */ diff --git a/src/native/windows/msofficecomm/WeakReference.cxx b/src/native/windows/msofficecomm/WeakReference.cxx new file mode 100644 index 0000000..a858917 --- /dev/null +++ b/src/native/windows/msofficecomm/WeakReference.cxx @@ -0,0 +1,47 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "WeakReference.h" + +STDMETHODIMP WeakReference::QueryInterface(REFIID iid, PVOID *obj) +{ + HRESULT hr; + + if (!obj) + hr = E_POINTER; + else if (IID_IWeakReferenceSource == iid) + { + /* + * While a weak reference to a weak reference should technically be + * possible, such functionality does not seem necessary at the time of + * this writing. + */ + *obj = NULL; + hr = E_NOINTERFACE; + } + else + hr = UnknownImpl::QueryInterface(iid, obj); + return hr; +} + +STDMETHODIMP WeakReference::Resolve(REFIID iid, PVOID *obj) +{ + HRESULT hr; + + if (obj) + { + if (_iUnknown) + hr = _iUnknown->QueryInterface(iid, obj); + else + { + *obj = NULL; + hr = E_FAIL; + } + } + else + hr = E_POINTER; + return hr; +} diff --git a/src/native/windows/msofficecomm/WeakReference.h b/src/native/windows/msofficecomm/WeakReference.h new file mode 100644 index 0000000..a00c5d7 --- /dev/null +++ b/src/native/windows/msofficecomm/WeakReference.h @@ -0,0 +1,33 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_WEAKREFERENCE_H_ +#define _JMSOFFICECOMM_WEAKREFERENCE_H_ + +#include "UnknownImpl.h" + +class WeakReference + : public UnknownImpl<IWeakReference, IID_IWeakReference> +{ +public: + WeakReference(LPUNKNOWN iUnknown) : _iUnknown(iUnknown) {} + + // IUnknown + STDMETHODIMP QueryInterface(REFIID, PVOID *); + + // IWeakReference + STDMETHODIMP Resolve(REFIID, PVOID *); + + void invalidate() { _iUnknown = NULL; } + +protected: + virtual ~WeakReference() {} + +private: + LPUNKNOWN _iUnknown; +}; + +#endif /* #ifndef _JMSOFFICECOMM_WEAKREFERENCE_H_ */ diff --git a/src/native/windows/msofficecomm/WeakReferenceSource.cxx b/src/native/windows/msofficecomm/WeakReferenceSource.cxx new file mode 100644 index 0000000..4bac616 --- /dev/null +++ b/src/native/windows/msofficecomm/WeakReferenceSource.cxx @@ -0,0 +1,37 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#include "WeakReferenceSource.h" + +#include "WeakReference.h" + +WeakReferenceSource::~WeakReferenceSource() +{ + if (_weakReference) + { + _weakReference->invalidate(); + _weakReference->Release(); + _weakReference = NULL; + } +} + +STDMETHODIMP +WeakReferenceSource::GetWeakReference(IWeakReference **weakReference) +{ + HRESULT hr; + + if (weakReference) + { + if (!_weakReference) + _weakReference = new WeakReference(_iUnknown); + _weakReference->AddRef(); + *weakReference = _weakReference; + hr = S_OK; + } + else + hr = E_POINTER; + return hr; +} diff --git a/src/native/windows/msofficecomm/WeakReferenceSource.h b/src/native/windows/msofficecomm/WeakReferenceSource.h new file mode 100644 index 0000000..8be3da2 --- /dev/null +++ b/src/native/windows/msofficecomm/WeakReferenceSource.h @@ -0,0 +1,89 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +#ifndef _JMSOFFICECOMM_WEAKREFERENCESOURCE_H_ +#define _JMSOFFICECOMM_WEAKREFERENCESOURCE_H_ + +#include "IWeakReferenceSource.h" + +class WeakReference; + +class WeakReferenceSource + : public IWeakReferenceSource +{ +public: + WeakReferenceSource(LPUNKNOWN iUnknown) + : _iUnknown(iUnknown), _weakReference(NULL) {} + virtual ~WeakReferenceSource(); + + // IUnknown + STDMETHODIMP QueryInterface(REFIID iid, PVOID *obj) + { return _iUnknown->QueryInterface(iid, obj); } + STDMETHODIMP_(ULONG) AddRef() + { return _iUnknown->AddRef(); } + STDMETHODIMP_(ULONG) Release() + { return _iUnknown->Release(); } + + // IWeakReferenceSource + STDMETHODIMP GetWeakReference(IWeakReference **weakReference); + +private: + const LPUNKNOWN _iUnknown; + WeakReference *_weakReference; +}; + +#define STDMETHODIMP_RESOLVE_WEAKREFERENCE_OR_NEW(out,weakReference,clazz,...) \ + { \ + HRESULT hr; \ +\ + if (out) \ + { \ + hr = E_FAIL; \ + if (weakReference) \ + { \ + hr = weakReference->Resolve(IID_IDispatch, (PVOID *) out); \ + if (FAILED(hr) && (E_NOINTERFACE != hr)) \ + { \ + weakReference->Release(); \ + weakReference = NULL; \ + } \ + } \ + if (FAILED(hr) && (E_NOINTERFACE != hr)) \ + { \ + clazz *obj = new clazz(__VA_ARGS__); \ + IWeakReferenceSource *weakReferenceSource; \ +\ + hr \ + = obj->QueryInterface( \ + IID_IWeakReferenceSource, \ + (PVOID *) &weakReferenceSource); \ + obj->Release(); \ + if (SUCCEEDED(hr)) \ + { \ + hr \ + = weakReferenceSource->GetWeakReference( \ + &weakReference); \ + if (SUCCEEDED(hr)) \ + { \ + hr \ + = weakReference->Resolve( \ + IID_IDispatch, \ + (PVOID *) out); \ + } \ + else \ + *out = NULL; \ + weakReferenceSource->Release(); \ + } \ + else \ + *out = NULL; \ + } \ + } \ + else \ + hr = RPC_X_NULL_REF_POINTER; \ + return hr; \ + } + +#endif /* #ifndef _JMSOFFICECOMM_WEAKREFERENCESOURCE_H_ */ diff --git a/src/native/windows/msofficecomm/net_java_sip_communicator_plugin_msofficecomm_Messenger.h b/src/native/windows/msofficecomm/net_java_sip_communicator_plugin_msofficecomm_Messenger.h new file mode 100644 index 0000000..b6ab094 --- /dev/null +++ b/src/native/windows/msofficecomm/net_java_sip_communicator_plugin_msofficecomm_Messenger.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class net_java_sip_communicator_plugin_msofficecomm_Messenger */ + +#ifndef _Included_net_java_sip_communicator_plugin_msofficecomm_Messenger +#define _Included_net_java_sip_communicator_plugin_msofficecomm_Messenger +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: net_java_sip_communicator_plugin_msofficecomm_Messenger + * Method: onContactStatusChange + * Signature: (Ljava/lang/String;I)V + */ +JNIEXPORT void JNICALL Java_net_java_sip_communicator_plugin_msofficecomm_Messenger_onContactStatusChange + (JNIEnv *, jclass, jstring, jint); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/native/windows/msofficecomm/net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer.h b/src/native/windows/msofficecomm/net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer.h new file mode 100644 index 0000000..c2ab755 --- /dev/null +++ b/src/native/windows/msofficecomm/net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include <jni.h> +/* Header for class net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer */ + +#ifndef _Included_net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer +#define _Included_net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer + * Method: start + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer_start + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer + * Method: stop + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_net_java_sip_communicator_plugin_msofficecomm_OutOfProcessServer_stop + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/net/java/sip/communicator/impl/argdelegation/argdelegation.manifest.mf b/src/net/java/sip/communicator/impl/argdelegation/argdelegation.manifest.mf index 2ad388b..31e3155 100644 --- a/src/net/java/sip/communicator/impl/argdelegation/argdelegation.manifest.mf +++ b/src/net/java/sip/communicator/impl/argdelegation/argdelegation.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.argdelegation.ArgDelegationActivator Bundle-Name: Argument Delegation Bundle-Description: A bundle that delegates invocation arguments to register handler services -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/browserlauncher/browserlauncher.manifest.mf b/src/net/java/sip/communicator/impl/browserlauncher/browserlauncher.manifest.mf index 2739c07..55a9449 100644 --- a/src/net/java/sip/communicator/impl/browserlauncher/browserlauncher.manifest.mf +++ b/src/net/java/sip/communicator/impl/browserlauncher/browserlauncher.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.browserlauncher.BrowserLauncherActivator Bundle-Name: Browser Launcher Bundle-Description: An implementation of the BrowserLauncher service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.browserlauncher diff --git a/src/net/java/sip/communicator/impl/callhistory/callhistory.manifest.mf b/src/net/java/sip/communicator/impl/callhistory/callhistory.manifest.mf index 44a6baf..6aab866 100644 --- a/src/net/java/sip/communicator/impl/callhistory/callhistory.manifest.mf +++ b/src/net/java/sip/communicator/impl/callhistory/callhistory.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.callhistory.CallHistoryActivator Bundle-Name: Call History Service Provider Bundle-Description: A bundle that implements the call history package. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/certificate/certificate.manifest.mf b/src/net/java/sip/communicator/impl/certificate/certificate.manifest.mf index 7e3f074..8699c8d 100644 --- a/src/net/java/sip/communicator/impl/certificate/certificate.manifest.mf +++ b/src/net/java/sip/communicator/impl/certificate/certificate.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.certificate.CertificateVerificationActivator Bundle-Name: Certificate Verification Activator Bundle-Description: A bundle that offers certificate verification -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.certificate diff --git a/src/net/java/sip/communicator/impl/configuration/configuration.manifest.mf b/src/net/java/sip/communicator/impl/configuration/configuration.manifest.mf index 9d2abfb..542af3d 100644 --- a/src/net/java/sip/communicator/impl/configuration/configuration.manifest.mf +++ b/src/net/java/sip/communicator/impl/configuration/configuration.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.configuration.ConfigurationActivator Bundle-Name: Configuration Service Implementation Bundle-Description: A bundle that offers configuration utilities -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/contactlist/meta.cl.manifest.mf b/src/net/java/sip/communicator/impl/contactlist/meta.cl.manifest.mf index 7b028d9..5d655e4 100644 --- a/src/net/java/sip/communicator/impl/contactlist/meta.cl.manifest.mf +++ b/src/net/java/sip/communicator/impl/contactlist/meta.cl.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.contactlist.ContactlistActivator Bundle-Name: MetaContactList Bundle-Description: An implementation of the MetaContactList service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/credentialsstorage/credentialsstorage.manifest.mf b/src/net/java/sip/communicator/impl/credentialsstorage/credentialsstorage.manifest.mf index 4b94a7d..9d7cb69 100644 --- a/src/net/java/sip/communicator/impl/credentialsstorage/credentialsstorage.manifest.mf +++ b/src/net/java/sip/communicator/impl/credentialsstorage/credentialsstorage.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.credentialsstorage.CredentialsStorageActivator Bundle-Name: Credentials Storage Service Implementation Bundle-Description: A bundle that handles credentials -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/fileaccess/fileaccess.manifest.mf b/src/net/java/sip/communicator/impl/fileaccess/fileaccess.manifest.mf index 5021ea4..df19ee5 100644 --- a/src/net/java/sip/communicator/impl/fileaccess/fileaccess.manifest.mf +++ b/src/net/java/sip/communicator/impl/fileaccess/fileaccess.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.fileaccess.FileAccessActivator Bundle-Name: File Access Service Provider Bundle-Description: A bundle that implements the file access package. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/filehistory/filehistory.manifest.mf b/src/net/java/sip/communicator/impl/filehistory/filehistory.manifest.mf index 50d8e76..9932f18 100644 --- a/src/net/java/sip/communicator/impl/filehistory/filehistory.manifest.mf +++ b/src/net/java/sip/communicator/impl/filehistory/filehistory.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.filehistory.FileHistoryActivator Bundle-Name: File History Service Provider Bundle-Description: A bundle that implements the file history package. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/galagonotification/galagonotification.manifest.mf b/src/net/java/sip/communicator/impl/galagonotification/galagonotification.manifest.mf index 3792419..e1fe3df 100644 --- a/src/net/java/sip/communicator/impl/galagonotification/galagonotification.manifest.mf +++ b/src/net/java/sip/communicator/impl/galagonotification/galagonotification.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.galagonotification.GalagoNotificationActivator Bundle-Name: Desktop Notifications Provider Bundle-Description: A bundle which implements notifications according to the freedesktop.org Desktop Notifications spec. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: javax.imageio, diff --git a/src/net/java/sip/communicator/impl/globalshortcut/globalshortcut.manifest.mf b/src/net/java/sip/communicator/impl/globalshortcut/globalshortcut.manifest.mf index e78282d..93aec4c 100644 --- a/src/net/java/sip/communicator/impl/globalshortcut/globalshortcut.manifest.mf +++ b/src/net/java/sip/communicator/impl/globalshortcut/globalshortcut.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.globalshortcut.GlobalShortcutActivator Bundle-Name: Global shortcut Bundle-Description: A bundle which implements global shortcut -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/googlecontacts/googlecontacts.manifest.mf b/src/net/java/sip/communicator/impl/googlecontacts/googlecontacts.manifest.mf index 61e62da..9629bf1 100644 --- a/src/net/java/sip/communicator/impl/googlecontacts/googlecontacts.manifest.mf +++ b/src/net/java/sip/communicator/impl/googlecontacts/googlecontacts.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.googlecontacts.GoogleContactsActivator Bundle-Name: Google Contacts Service Implementation Bundle-Description: A bundle that offers access to Google Contacts -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/growlnotification/growlnotification.manifest.mf b/src/net/java/sip/communicator/impl/growlnotification/growlnotification.manifest.mf index 95fc79a..27444f4 100644 --- a/src/net/java/sip/communicator/impl/growlnotification/growlnotification.manifest.mf +++ b/src/net/java/sip/communicator/impl/growlnotification/growlnotification.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.growlnotification.GrowlNotificationActivator Bundle-Name: Growl Notification Service Provider Bundle-Description: A bundle which implements Growl notifications. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java b/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java index e9bdb53..853ffb9 100644 --- a/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java +++ b/src/net/java/sip/communicator/impl/gui/UIServiceImpl.java @@ -21,6 +21,7 @@ import net.java.sip.communicator.impl.gui.event.*; import net.java.sip.communicator.impl.gui.lookandfeel.*; import net.java.sip.communicator.impl.gui.main.*; import net.java.sip.communicator.impl.gui.main.account.*; +import net.java.sip.communicator.impl.gui.main.call.*; import net.java.sip.communicator.impl.gui.main.chat.*; import net.java.sip.communicator.impl.gui.main.chat.conference.*; import net.java.sip.communicator.impl.gui.main.chat.history.*; @@ -1472,4 +1473,24 @@ public class UIServiceImpl { return new NewAccountDialog(); } + + public void createCall(String[] participants) + { + if (participants.length == 1) + { + CallManager.createCall(participants[0], null); + } + else + throw new IllegalArgumentException("participants"); + } + + public void startChat(String[] participants) + { + if (participants.length == 1) + { + getChatWindowManager().startChat(participants[0]); + } + else + throw new IllegalArgumentException("participants"); + } }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java index 8f0da9a..c9d9244 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java @@ -795,25 +795,66 @@ public class CallManager } else if (telephonyProviders.size() > 1) { - ChooseCallAccountPopupMenu chooseAccountDialog - = new ChooseCallAccountPopupMenu( - c, - callString, - telephonyProviders, - l); - - chooseAccountDialog - .setLocation(c.getLocation()); - chooseAccountDialog.showPopupMenu(); + /* + * Allow plugins which do not have a (Jitsi) UI to create calls by + * automagically picking up a telephony provider. + */ + if (c == null) + { + ProtocolProviderService preferredTelephonyProvider = null; + + for (ProtocolProviderService telephonyProvider + : telephonyProviders) + { + try + { + OperationSetPresence presenceOpSet + = telephonyProvider.getOperationSet( + OperationSetPresence.class); + + if ((presenceOpSet != null) + && (presenceOpSet.findContactByID(callString) + != null)) + { + preferredTelephonyProvider = telephonyProvider; + break; + } + } + catch (Throwable t) + { + if (t instanceof ThreadDeath) + throw (ThreadDeath) t; + } + } + if (preferredTelephonyProvider == null) + preferredTelephonyProvider = telephonyProviders.get(0); + + CallManager.createCall(preferredTelephonyProvider, callString); + if (l != null) + l.callInterfaceStarted(); + } + else + { + ChooseCallAccountPopupMenu chooseAccountDialog + = new ChooseCallAccountPopupMenu( + c, + callString, + telephonyProviders, + l); + + chooseAccountDialog.setLocation(c.getLocation()); + chooseAccountDialog.showPopupMenu(); + } } else { new ErrorDialog( - null, - GuiActivator.getResources().getI18NString("service.gui.WARNING"), - GuiActivator.getResources().getI18NString( - "service.gui.NO_ONLINE_TELEPHONY_ACCOUNT")) - .showDialog(); + null, + GuiActivator.getResources().getI18NString( + "service.gui.WARNING"), + GuiActivator.getResources().getI18NString( + "service.gui.NO_ONLINE_TELEPHONY_ACCOUNT")) + .showDialog(); } } diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java index 854b685..7962e87 100644 --- a/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java +++ b/src/net/java/sip/communicator/impl/gui/main/chat/ChatWindowManager.java @@ -772,6 +772,54 @@ public class ChatWindowManager metaContact, protocolContact, isSmsMessage)); } + public void startChat(String contactString) + { + List<ProtocolProviderService> imProviders + = GuiActivator.getRegisteredProviders( + OperationSetBasicInstantMessaging.class); + + if (imProviders.size() < 1) + throw new IllegalStateException("imProviders"); + + Contact contact = null; + MetaContactListService metaContactListService + = GuiActivator.getContactListService(); + MetaContact metaContact = null; + boolean startChat = false; + + for (ProtocolProviderService imProvider : imProviders) + { + try + { + OperationSetPresence presenceOpSet + = imProvider.getOperationSet(OperationSetPresence.class); + + if (presenceOpSet != null) + { + contact = presenceOpSet.findContactByID(contactString); + if (contact != null) + { + metaContact + = metaContactListService.findMetaContactByContact( + contact); + if (metaContact != null) + { + startChat = true; + break; + } + } + } + } + catch (Throwable t) + { + if (t instanceof ThreadDeath) + throw (ThreadDeath) t; + } + } + if (startChat) + startChat(metaContact, contact, false); + } + /** * Removes the non read state of the currently selected chat session. This * will result in removal of all icons representing the non read state (like diff --git a/src/net/java/sip/communicator/impl/gui/swing.ui.manifest.mf b/src/net/java/sip/communicator/impl/gui/swing.ui.manifest.mf index bf871c6..4b8512a 100644 --- a/src/net/java/sip/communicator/impl/gui/swing.ui.manifest.mf +++ b/src/net/java/sip/communicator/impl/gui/swing.ui.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.gui.GuiActivator Bundle-Name: UI Service Provider Implementation Bundle-Description: An implementation of the UI service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/hid/hid.manifest.mf b/src/net/java/sip/communicator/impl/hid/hid.manifest.mf index b55a5ce..504fb2d 100644 --- a/src/net/java/sip/communicator/impl/hid/hid.manifest.mf +++ b/src/net/java/sip/communicator/impl/hid/hid.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.hid.HIDActivator Bundle-Name: HID Service Implementation Bundle-Description: A bundle that offers Human Interaction features. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/history/history.manifest.mf b/src/net/java/sip/communicator/impl/history/history.manifest.mf index f5f52fc..bc08a6d 100644 --- a/src/net/java/sip/communicator/impl/history/history.manifest.mf +++ b/src/net/java/sip/communicator/impl/history/history.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.history.HistoryActivator Bundle-Name: History Service Provider Bundle-Description: A bundle that implements the history package. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/keybindings/keybindings.manifest.mf b/src/net/java/sip/communicator/impl/keybindings/keybindings.manifest.mf index 0d89efd..278a3c9 100644 --- a/src/net/java/sip/communicator/impl/keybindings/keybindings.manifest.mf +++ b/src/net/java/sip/communicator/impl/keybindings/keybindings.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.keybindings.KeybindingsActivator Bundle-Name: Keybindings Bundle-Description: Provides management and persistence of keyboard shortcuts. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/ldap/ldap.manifest.mf b/src/net/java/sip/communicator/impl/ldap/ldap.manifest.mf index 183a67f..248ca89 100644 --- a/src/net/java/sip/communicator/impl/ldap/ldap.manifest.mf +++ b/src/net/java/sip/communicator/impl/ldap/ldap.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.ldap.LdapActivator Bundle-Name: LDAP service provider Bundle-Description: A bundle that implements LDAP service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/metahistory/metahistory.manifest.mf b/src/net/java/sip/communicator/impl/metahistory/metahistory.manifest.mf index 9f4fcd6..0466886 100644 --- a/src/net/java/sip/communicator/impl/metahistory/metahistory.manifest.mf +++ b/src/net/java/sip/communicator/impl/metahistory/metahistory.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.metahistory.MetaHistoryActivator Bundle-Name: Meta History Service Provider Bundle-Description: A bundle that implements the meta history package. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/msghistory/msghistory.manifest.mf b/src/net/java/sip/communicator/impl/msghistory/msghistory.manifest.mf index ffeac0a..e2733ee 100644 --- a/src/net/java/sip/communicator/impl/msghistory/msghistory.manifest.mf +++ b/src/net/java/sip/communicator/impl/msghistory/msghistory.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.msghistory.MessageHistoryActivator Bundle-Name: Message History Service Provider Bundle-Description: A bundle that implements the message history package. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf b/src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf index b19a583..e197905 100644 --- a/src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf +++ b/src/net/java/sip/communicator/impl/neomedia/neomedia.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.neomedia.NeomediaActivator Bundle-Name: Neomedia Service Implementation Bundle-Description: A bundle that offers Media capture and presentation capabilities. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.bouncycastle.crypto, diff --git a/src/net/java/sip/communicator/impl/netaddr/netaddr.manifest.mf b/src/net/java/sip/communicator/impl/netaddr/netaddr.manifest.mf index eb983c7..597d606 100644 --- a/src/net/java/sip/communicator/impl/netaddr/netaddr.manifest.mf +++ b/src/net/java/sip/communicator/impl/netaddr/netaddr.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.netaddr.NetaddrActivator Bundle-Name: Network Address Management service Bundle-Description: A bundle that provides local address selection and negotiation via ice4j. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: net.java.sip.communicator.service.configuration, diff --git a/src/net/java/sip/communicator/impl/notification/notification.manifest.mf b/src/net/java/sip/communicator/impl/notification/notification.manifest.mf index 4ac8cb2..c3b7bf9 100644 --- a/src/net/java/sip/communicator/impl/notification/notification.manifest.mf +++ b/src/net/java/sip/communicator/impl/notification/notification.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.notification.NotificationActivator Bundle-Name: Notifications Bundle-Description: An implementation of the Notification service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/osdependent/osdependent.manifest.mf b/src/net/java/sip/communicator/impl/osdependent/osdependent.manifest.mf index 11c0aa5..0b3a30f 100644 --- a/src/net/java/sip/communicator/impl/osdependent/osdependent.manifest.mf +++ b/src/net/java/sip/communicator/impl/osdependent/osdependent.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.osdependent.OsDependentActivator
Bundle-Name: OS dependent
Bundle-Description: OS dependent.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Export-Package: net.java.sip.communicator.service.systray,
diff --git a/src/net/java/sip/communicator/impl/packetlogging/packetlogging.manifest.mf b/src/net/java/sip/communicator/impl/packetlogging/packetlogging.manifest.mf index 7cdd3b7..c7800d3 100644 --- a/src/net/java/sip/communicator/impl/packetlogging/packetlogging.manifest.mf +++ b/src/net/java/sip/communicator/impl/packetlogging/packetlogging.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.packetlogging.PacketLoggingActivator Bundle-Name: Packet Logging service Bundle-Description: A bundle that provides packet logging in pcap file format -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/dict/dict.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/dict/dict.provider.manifest.mf index 6d31b7b..4d0dc97 100644 --- a/src/net/java/sip/communicator/impl/protocol/dict/dict.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/dict/dict.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.dict.DictActivator Bundle-Name: Dict Protocol Provider Bundle-Description: A bundle providing support for the Dict protocol. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/gibberish/gibberish.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/gibberish/gibberish.provider.manifest.mf index a705687..f026f4c 100644 --- a/src/net/java/sip/communicator/impl/protocol/gibberish/gibberish.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/gibberish/gibberish.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.gibberish.GibberishActivator Bundle-Name: Gibberish Protocol Provider Bundle-Description: A bundle providing support for the Gibberish protocol. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/icq/icq.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/icq/icq.provider.manifest.mf index 8fe197d..b5d3641 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/icq.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/icq/icq.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.icq.IcqActivator Bundle-Name: ICQ Protocol Provider Implementation Bundle-Description: An ICQ/AIM implementation of the Protocol Provider Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/irc/irc.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/irc/irc.provider.manifest.mf index fb96241..1970232 100644 --- a/src/net/java/sip/communicator/impl/protocol/irc/irc.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/irc/irc.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.irc.IrcActivator Bundle-Name: Irc Protocol Provider Bundle-Description: A bundle providing support for the Irc protocol. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/jabber.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/jabber/jabber.provider.manifest.mf index c02dfc5..8872df0 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/jabber.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/jabber/jabber.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.jabber.JabberActivator Bundle-Name: Jabber Protocol Provider Implementation Bundle-Description: An Jabber implementation of the Protocol Provider Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/mock/mock.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/mock/mock.provider.manifest.mf index c7e72e2..99f3451 100644 --- a/src/net/java/sip/communicator/impl/protocol/mock/mock.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/mock/mock.provider.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: MockProvider Bundle-Description: Mock provider service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: net.java.sip.communicator.service.contactlist, diff --git a/src/net/java/sip/communicator/impl/protocol/msn/msn.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/msn/msn.provider.manifest.mf index b7c7a2d..bc21688 100644 --- a/src/net/java/sip/communicator/impl/protocol/msn/msn.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/msn/msn.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.msn.MsnActivator Bundle-Name: Msn Protocol Provider Implementation Bundle-Description: An Msn implementation of the Protocol Provider Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.apache.commons.logging, diff --git a/src/net/java/sip/communicator/impl/protocol/rss/rss.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/rss/rss.provider.manifest.mf index 4533ae0..6a018f0 100644 --- a/src/net/java/sip/communicator/impl/protocol/rss/rss.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/rss/rss.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.rss.RssActivator Bundle-Name: Rss Protocol Provider Bundle-Description: A bundle providing support for the Rss protocol. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf index dc9ef72..6f586f4 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/sip/sip.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.sip.SipActivator Bundle-Name: SIP Communicator SIP Protocol Provider Bundle-Description: A bundle that implements the Protocol Provider package over SIP. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.apache.log4j, diff --git a/src/net/java/sip/communicator/impl/protocol/ssh/ssh.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/ssh/ssh.provider.manifest.mf index af73cee..682107a 100644 --- a/src/net/java/sip/communicator/impl/protocol/ssh/ssh.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/ssh/ssh.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.ssh.SSHActivator Bundle-Name: SSH Protocol Provider Bundle-Description: A bundle providing support for the SSH protocol. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/yahoo/yahoo.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/yahoo/yahoo.provider.manifest.mf index c24547c..d399757 100644 --- a/src/net/java/sip/communicator/impl/protocol/yahoo/yahoo.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/yahoo/yahoo.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.yahoo.YahooActivator Bundle-Name: Yahoo Protocol Provider Implementation Bundle-Description: An Yahoo implementation of the Protocol Provider Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/protocol/zeroconf/zeroconf.provider.manifest.mf b/src/net/java/sip/communicator/impl/protocol/zeroconf/zeroconf.provider.manifest.mf index b3e9d21..ce58820 100644 --- a/src/net/java/sip/communicator/impl/protocol/zeroconf/zeroconf.provider.manifest.mf +++ b/src/net/java/sip/communicator/impl/protocol/zeroconf/zeroconf.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.protocol.zeroconf.ZeroconfActivator Bundle-Name: Zeroconf Protocol Provider Bundle-Description: A bundle providing support for the Zeroconf protocol. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/provdisc/dhcp/dhcp.provdisc.manifest.mf b/src/net/java/sip/communicator/impl/provdisc/dhcp/dhcp.provdisc.manifest.mf index 6663e51..aeb4691 100644 --- a/src/net/java/sip/communicator/impl/provdisc/dhcp/dhcp.provdisc.manifest.mf +++ b/src/net/java/sip/communicator/impl/provdisc/dhcp/dhcp.provdisc.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.provdisc.dhcp.ProvisioningDiscoveryDHCPActivator Bundle-Name: DHCP provisioning discovery Bundle-Description: A bundle providing support for DHCP provisioning discovery -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/provdisc/mdns/mdns.provdisc.manifest.mf b/src/net/java/sip/communicator/impl/provdisc/mdns/mdns.provdisc.manifest.mf index b068c62..6b5a3c9 100644 --- a/src/net/java/sip/communicator/impl/provdisc/mdns/mdns.provdisc.manifest.mf +++ b/src/net/java/sip/communicator/impl/provdisc/mdns/mdns.provdisc.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.provdisc.mdns.ProvisioningDiscoveryMDNSActivator Bundle-Name: mDNS provisioning discovery Bundle-Description: A bundle providing support for mDNS provisioning discovery -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf index bb90e36..6fc5ea1 100644 --- a/src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/bliptv/bliptv.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.bliptv.BliptvActivator Bundle-Name: Blip.tv Preview Replacement Source Bundle-Description: A bundle providing processing for Blip.tv previews. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/dailymotion/dailymotion.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/dailymotion/dailymotion.source.manifest.mf index 1b7757c..019f210 100644 --- a/src/net/java/sip/communicator/impl/replacement/dailymotion/dailymotion.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/dailymotion/dailymotion.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.dailymotion.DailymotionActivator Bundle-Name: Dailymotion Replacement Source Bundle-Description: A bundle providing replacement for dailymotion links. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/directimage/directimage.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/directimage/directimage.source.manifest.mf index a4e4e85..331f522 100644 --- a/src/net/java/sip/communicator/impl/replacement/directimage/directimage.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/directimage/directimage.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.directimage.DirectImageActivator Bundle-Name: Direct Image Link Replacement Source Bundle-Description: A bundle providing replacement for direct image links. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf index 0ea5ee1..5d91f2c 100644 --- a/src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/flickr/flickr.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.flickr.FlickrActivator Bundle-Name: Flickr Preview Replacement Source Bundle-Description: A bundle providing processing for flickr previews. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf index 25202a5..39d1b51 100644 --- a/src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/hulu/hulu.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.hulu.HuluActivator Bundle-Name: Hulu Preview Replacement Source Bundle-Description: A bundle providing processing for Hulu previews. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/metacafe/metacafe.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/metacafe/metacafe.source.manifest.mf index 651091e..df61223 100644 --- a/src/net/java/sip/communicator/impl/replacement/metacafe/metacafe.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/metacafe/metacafe.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.metacafe.MetacafeActivator Bundle-Name: Metacafe Preview Replacement Source Bundle-Description: A bundle providing processing for metacafe previews. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/smiley/smiley.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/smiley/smiley.source.manifest.mf index 02f007c..34ce08c 100644 --- a/src/net/java/sip/communicator/impl/replacement/smiley/smiley.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/smiley/smiley.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.smiley.SmileyActivator Bundle-Name: Smiley Replacement Source Bundle-Description: A bundle providing processing for smileys. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/twitpic/twitpic.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/twitpic/twitpic.source.manifest.mf index 100b524..7e70d84 100644 --- a/src/net/java/sip/communicator/impl/replacement/twitpic/twitpic.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/twitpic/twitpic.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.twitpic.TwitpicActivator Bundle-Name: Twitpic Preview Replacement Source Bundle-Description: A bundle providing processing for Twitpic previews. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/vbox7/vbox7.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/vbox7/vbox7.source.manifest.mf index 39ab304..60e802e 100644 --- a/src/net/java/sip/communicator/impl/replacement/vbox7/vbox7.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/vbox7/vbox7.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.vbox7.Vbox7Activator Bundle-Name: Vbox7 Preview Replacement Source Bundle-Description: A bundle providing processing for vbox7 previews. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/viddler/viddler.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/viddler/viddler.source.manifest.mf index 732d2bb..2c5ca73f 100644 --- a/src/net/java/sip/communicator/impl/replacement/viddler/viddler.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/viddler/viddler.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.viddler.ViddlerActivator Bundle-Name: Viddler Preview Replacement Source Bundle-Description: A bundle providing processing for Viddler previews. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf index 4829910..0b7c8a9 100644 --- a/src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/vimeo/vimeo.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.vimeo.VimeoActivator Bundle-Name: Vimeo Preview Replacement Source Bundle-Description: A bundle providing processing for vimeo previews. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf b/src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf index cbfd94c..c64f517 100644 --- a/src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf +++ b/src/net/java/sip/communicator/impl/replacement/youtube/youtube.source.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.replacement.youtube.YoutubeActivator Bundle-Name: Youtube Replacement Source Bundle-Description: A bundle providing replacement for youtube links. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 1.0.0 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/resources/resourcemanagement.manifest.mf b/src/net/java/sip/communicator/impl/resources/resourcemanagement.manifest.mf index bae99ed..83fe651 100644 --- a/src/net/java/sip/communicator/impl/resources/resourcemanagement.manifest.mf +++ b/src/net/java/sip/communicator/impl/resources/resourcemanagement.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.resources.ResourceManagementActivator Bundle-Name: Resource Management Service Bundle-Description: The plugin managing images and languages resource packs. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.resources diff --git a/src/net/java/sip/communicator/impl/shutdowntimeout/shutdown.timeout.manifest.mf b/src/net/java/sip/communicator/impl/shutdowntimeout/shutdown.timeout.manifest.mf index e57e552..6814497 100644 --- a/src/net/java/sip/communicator/impl/shutdowntimeout/shutdown.timeout.manifest.mf +++ b/src/net/java/sip/communicator/impl/shutdowntimeout/shutdown.timeout.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.shutdowntimeout.ShutdownTimeout Bundle-Name: ShutdownBundle Bundle-Description: A bundle that makes sure that when closed SIP Communicator will exit in 15 seconds at most. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/sparkle/sparkle.manifest.mf b/src/net/java/sip/communicator/impl/sparkle/sparkle.manifest.mf index eaadf1f..ea95881 100644 --- a/src/net/java/sip/communicator/impl/sparkle/sparkle.manifest.mf +++ b/src/net/java/sip/communicator/impl/sparkle/sparkle.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.sparkle.SparkleActivator Bundle-Name: Sparkle Auto-Update Service Provider Bundle-Description: A bundle that launches the Sparkle framework. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf b/src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf index d665ba5..7fb8867 100644 --- a/src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf +++ b/src/net/java/sip/communicator/impl/swingnotification/swingnotification.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.swingnotification.SwingNotificationActivator
Bundle-Name: Swing Notification Service Provider
Bundle-Description: A bundle which implements Swing notifications.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/impl/sysactivity/sysactivity.impl.manifest.mf b/src/net/java/sip/communicator/impl/sysactivity/sysactivity.impl.manifest.mf index db284f9..f60184d 100644 --- a/src/net/java/sip/communicator/impl/sysactivity/sysactivity.impl.manifest.mf +++ b/src/net/java/sip/communicator/impl/sysactivity/sysactivity.impl.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.sysactivity.SysActivityActivator
Bundle-Name: System Activity Service Implementation
Bundle-Description: System Activity Service Implementation.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/impl/version/version.impl.manifest.mf b/src/net/java/sip/communicator/impl/version/version.impl.manifest.mf index 86b2958..0f3f76e 100755 --- a/src/net/java/sip/communicator/impl/version/version.impl.manifest.mf +++ b/src/net/java/sip/communicator/impl/version/version.impl.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.impl.version.VersionActivator Bundle-Name: Version Service Implementation Bundle-Description: Version Service Implementation. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/accountinfo/accountinfo.manifest.mf b/src/net/java/sip/communicator/plugin/accountinfo/accountinfo.manifest.mf index 6281899..47ccf4b 100644 --- a/src/net/java/sip/communicator/plugin/accountinfo/accountinfo.manifest.mf +++ b/src/net/java/sip/communicator/plugin/accountinfo/accountinfo.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.accountinfo.AccountInfoActivator
Bundle-Name: Contact Info
Bundle-Description: A plug-in that can set cross protocol account info.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/addrbook/addrbook.manifest.mf b/src/net/java/sip/communicator/plugin/addrbook/addrbook.manifest.mf index b42344a..70110fb 100644 --- a/src/net/java/sip/communicator/plugin/addrbook/addrbook.manifest.mf +++ b/src/net/java/sip/communicator/plugin/addrbook/addrbook.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.addrbook.AddrBookActivator
Bundle-Description: OS-specific Address Book support
Bundle-Name: OS-specific Address Book support
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
Import-Package: javax.swing,
net.java.sip.communicator.service.configuration,
diff --git a/src/net/java/sip/communicator/plugin/advancedconfig/advancedconfig.manifest.mf b/src/net/java/sip/communicator/plugin/advancedconfig/advancedconfig.manifest.mf index 9eec552..8bd44ca 100644 --- a/src/net/java/sip/communicator/plugin/advancedconfig/advancedconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/advancedconfig/advancedconfig.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.advancedconfig.AdvancedConfigActivator Bundle-Name: Advanced config plugin Bundle-Description: The plugin offering advanced configuration page. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/aimaccregwizz/aimaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/aimaccregwizz/aimaccregwizz.manifest.mf index ce8d9fd..b591932 100644 --- a/src/net/java/sip/communicator/plugin/aimaccregwizz/aimaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/aimaccregwizz/aimaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.aimaccregwizz.AimAccRegWizzActivator Bundle-Name: AIM account registration wizard Bundle-Description: AIM account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf b/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf index 048e7e1..9388e0d 100755 --- a/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf +++ b/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.branding.BrandingActivator Bundle-Name: Branding plugin Bundle-Description: Branding plugin. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/certconfig/certconfig.manifest.mf b/src/net/java/sip/communicator/plugin/certconfig/certconfig.manifest.mf index 679e141..99a9899 100644 --- a/src/net/java/sip/communicator/plugin/certconfig/certconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/certconfig/certconfig.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.certconfig.CertConfigActivator Bundle-Name: Certificate Configuration Plugin Bundle-Description: Allows the configuration of general X.509 certificate settings. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: no Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/chatalerter/chatalerter.manifest.mf b/src/net/java/sip/communicator/plugin/chatalerter/chatalerter.manifest.mf index 0991755..ac6b9eb 100644 --- a/src/net/java/sip/communicator/plugin/chatalerter/chatalerter.manifest.mf +++ b/src/net/java/sip/communicator/plugin/chatalerter/chatalerter.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.chatalerter.ChatAlerterActivator
Bundle-Name: Chat Alerter
Bundle-Description: A plug-in that alerts for new messages by flashing the window in the taskbar.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/chatconfig/chatconfig.manifest.mf b/src/net/java/sip/communicator/plugin/chatconfig/chatconfig.manifest.mf index 8e62303..49d96b5 100644 --- a/src/net/java/sip/communicator/plugin/chatconfig/chatconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/chatconfig/chatconfig.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.chatconfig.ChatConfigActivator Bundle-Name: Plugin Manager Chat Bundle-Description: Manage all chat options. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/contactinfo/contactinfo.manifest.mf b/src/net/java/sip/communicator/plugin/contactinfo/contactinfo.manifest.mf index c508e73..1e1e3bc 100644 --- a/src/net/java/sip/communicator/plugin/contactinfo/contactinfo.manifest.mf +++ b/src/net/java/sip/communicator/plugin/contactinfo/contactinfo.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.contactinfo.ContactInfoActivator
Bundle-Name: Contact Info
Bundle-Description: A plug-in that can show cross protocol user info.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/contactsourceconfig/contactsourceconfig.manifest.mf b/src/net/java/sip/communicator/plugin/contactsourceconfig/contactsourceconfig.manifest.mf index f74b575..8b306b4 100644 --- a/src/net/java/sip/communicator/plugin/contactsourceconfig/contactsourceconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/contactsourceconfig/contactsourceconfig.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.contactsourceconfig.ContactSourceConfigActivator
Bundle-Description: Contact sources configuration Bundle-Name: Contact sources configuration -Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
Import-Package: net.java.sip.communicator.service.contactsource,
net.java.sip.communicator.service.protocol,
diff --git a/src/net/java/sip/communicator/plugin/defaultresourcepack/defaultresourcepack.manifest.mf b/src/net/java/sip/communicator/plugin/defaultresourcepack/defaultresourcepack.manifest.mf index 5b1a4e4..a6c46c6 100644 --- a/src/net/java/sip/communicator/plugin/defaultresourcepack/defaultresourcepack.manifest.mf +++ b/src/net/java/sip/communicator/plugin/defaultresourcepack/defaultresourcepack.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.defaultresourcepack.DefaultResourcePackActivator Bundle-Name: Default Resource Pack Bundle-Description: The plugin offering default images and languages. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/dictaccregwizz/dictaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/dictaccregwizz/dictaccregwizz.manifest.mf index 30831ad..7e9a51c 100644 --- a/src/net/java/sip/communicator/plugin/dictaccregwizz/dictaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/dictaccregwizz/dictaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.dictaccregwizz.DictAccRegWizzActivator Bundle-Name: Dict account registration wizard Bundle-Description: Dict account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/dnsconfig/dnsconfig.manifest.mf b/src/net/java/sip/communicator/plugin/dnsconfig/dnsconfig.manifest.mf index 4d414c0..61c903d 100644 --- a/src/net/java/sip/communicator/plugin/dnsconfig/dnsconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/dnsconfig/dnsconfig.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.dnsconfig.DnsConfigActivator Bundle-Name: DNSConfig Bundle-Description: DNS configuration plugin -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: no Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf b/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf index 31f89c6..f683c87 100644 --- a/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf +++ b/src/net/java/sip/communicator/plugin/exampleplugin/exampleplugin.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.exampleplugin.ExamplePluginActivator Bundle-Name: Example plugin Bundle-Description: An example showing how to make plugins for the ui. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/facebookaccregwizz/facebookaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/facebookaccregwizz/facebookaccregwizz.manifest.mf index 08019ec..5e5b36e 100644 --- a/src/net/java/sip/communicator/plugin/facebookaccregwizz/facebookaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/facebookaccregwizz/facebookaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.facebookaccregwizz.FacebookAccRegWizzActivator
Bundle-Name: Facebook account registration wizard
Bundle-Description: Facebook account registration wizard.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/generalconfig.manifest.mf b/src/net/java/sip/communicator/plugin/generalconfig/generalconfig.manifest.mf index 65917b7..91d7c24 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/generalconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/generalconfig/generalconfig.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.generalconfig.GeneralConfigPluginActivator Bundle-Name: General config plugin Bundle-Description: The plugin offering general configuration page. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/gibberishaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/gibberishaccregwizz.manifest.mf index f444110..98aacf2 100644 --- a/src/net/java/sip/communicator/plugin/gibberishaccregwizz/gibberishaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/gibberishaccregwizz/gibberishaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.gibberishaccregwizz.GibberishAccRegWizzActivator Bundle-Name: Gibberish account registration wizard Bundle-Description: Gibberish account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/globalproxyconfig/globalproxyconfig.manifest.mf b/src/net/java/sip/communicator/plugin/globalproxyconfig/globalproxyconfig.manifest.mf index 5ea6364..fae4f8d 100644 --- a/src/net/java/sip/communicator/plugin/globalproxyconfig/globalproxyconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/globalproxyconfig/globalproxyconfig.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.globalproxyconfig.GlobalProxyPluginActivator
Bundle-Name: Global Proxy Config Plugin
Bundle-Description: A plugin to configure global proxy for sip communicator
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/googletalkaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/googletalkaccregwizz.manifest.mf index 4dc8797..c63b034 100644 --- a/src/net/java/sip/communicator/plugin/googletalkaccregwizz/googletalkaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/googletalkaccregwizz/googletalkaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.googletalkaccregwizz.GoogleTalkAccRegWizzActivator
Bundle-Name: Google Talk account registration wizard
Bundle-Description: Google Talk account registration wizard.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/icqaccregwizz/icqaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/icqaccregwizz/icqaccregwizz.manifest.mf index cb55611..d6d6358 100644 --- a/src/net/java/sip/communicator/plugin/icqaccregwizz/icqaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/icqaccregwizz/icqaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.icqaccregwizz.IcqAccRegWizzActivator Bundle-Name: ICQ account registration wizard Bundle-Description: ICQ account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf index 3ec7734..42ed35a 100644 --- a/src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/ippiaccregwizz/ippiaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.ippiaccregwizz.IppiAccRegWizzActivator Bundle-Name: Ippi account registration wizard Bundle-Description: Ippi account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/iptelaccregwizz/iptelaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/iptelaccregwizz/iptelaccregwizz.manifest.mf index 64465ca..bb42ab4 100644 --- a/src/net/java/sip/communicator/plugin/iptelaccregwizz/iptelaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/iptelaccregwizz/iptelaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.iptelaccregwizz.IptelAccRegWizzActivator
Bundle-Name: IP Tel account registration wizard
Bundle-Description: IP Tel account registration wizard.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/ircaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/ircaccregwizz/ircaccregwizz.manifest.mf index 1b34840..ccc4971 100644 --- a/src/net/java/sip/communicator/plugin/ircaccregwizz/ircaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/ircaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.ircaccregwizz.IrcAccRegWizzActivator Bundle-Name: IRC account registration wizard Bundle-Description: IRC account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/jabberaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/jabberaccregwizz/jabberaccregwizz.manifest.mf index 0ab4d5d..4a06c85 100755 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/jabberaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/jabberaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.jabberaccregwizz.JabberAccRegWizzActivator Bundle-Name: Jabber account registration wizard Bundle-Description: Jabber account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-package: net.java.sip.communicator.plugin.jabberaccregwizz diff --git a/src/net/java/sip/communicator/plugin/keybindingchooser/keybindingChooser.manifest.mf b/src/net/java/sip/communicator/plugin/keybindingchooser/keybindingChooser.manifest.mf index 85d2bcb..26c5658 100644 --- a/src/net/java/sip/communicator/plugin/keybindingchooser/keybindingChooser.manifest.mf +++ b/src/net/java/sip/communicator/plugin/keybindingchooser/keybindingChooser.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.keybindingchooser.KeybindingChooserActivator Bundle-Name: Keybinding Chooser Bundle-Description: Provides configuring UI for keyboard shortcuts. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/ldap/ldap.manifest.mf b/src/net/java/sip/communicator/plugin/ldap/ldap.manifest.mf index f6d602a..a6a00ba 100644 --- a/src/net/java/sip/communicator/plugin/ldap/ldap.manifest.mf +++ b/src/net/java/sip/communicator/plugin/ldap/ldap.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.ldap.LdapActivator Bundle-Description: LDAP support Bundle-Name: LDAP support -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 Import-Package: net.java.sip.communicator.service.contactsource, net.java.sip.communicator.service.resources, diff --git a/src/net/java/sip/communicator/plugin/loggingutils/loggingutils.manifest.mf b/src/net/java/sip/communicator/plugin/loggingutils/loggingutils.manifest.mf index c434fdc..284b596 100644 --- a/src/net/java/sip/communicator/plugin/loggingutils/loggingutils.manifest.mf +++ b/src/net/java/sip/communicator/plugin/loggingutils/loggingutils.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.loggingutils.LoggingUtilsActivator Bundle-Name: Logging utils Bundle-Description: A bundle that provides packet logging utils as config and saving archived logs -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/msnaccregwizz/msnaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/msnaccregwizz/msnaccregwizz.manifest.mf index 871fefe..c151aec 100755 --- a/src/net/java/sip/communicator/plugin/msnaccregwizz/msnaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/msnaccregwizz/msnaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.msnaccregwizz.MsnAccRegWizzActivator Bundle-Name: Msn account registration wizard Bundle-Description: Msn account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/msofficecomm/Messenger.java b/src/net/java/sip/communicator/plugin/msofficecomm/Messenger.java new file mode 100644 index 0000000..02cf438 --- /dev/null +++ b/src/net/java/sip/communicator/plugin/msofficecomm/Messenger.java @@ -0,0 +1,464 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.plugin.msofficecomm; + +import java.beans.*; +import java.util.*; + +import javax.swing.*; + +import net.java.sip.communicator.service.gui.*; +import net.java.sip.communicator.service.protocol.*; +import net.java.sip.communicator.service.protocol.event.*; +import net.java.sip.communicator.util.*; + +import org.osgi.framework.*; + +/** + * Represents the Java counterpart of a native <tt>IMessenger</tt> + * implementation. + * + * @author Lyubomir Marinov + */ +public class Messenger +{ + static final int CONVERSATION_TYPE_AUDIO = 8; + + static final int CONVERSATION_TYPE_IM = 1; + + static final int CONVERSATION_TYPE_LIVEMEETING = 4; + + static final int CONVERSATION_TYPE_PHONE = 2; + + static final int CONVERSATION_TYPE_PSTN = 32; + + static final int CONVERSATION_TYPE_VIDEO = 16; + + static final int MISTATUS_AWAY = 0x0022; + + static final int MISTATUS_MAY_BE_AVAILABLE = 0x00A2; + + static final int MISTATUS_OFFLINE = 0x0001; + + static final int MISTATUS_ONLINE = 0x0002; + + static final int MISTATUS_UNKNOWN = 0x0000; + + /** + * The <tt>BundleContext</tt> in which the <tt>msofficecomm</tt> bundle has + * been started. + */ + private static BundleContext bundleContext; + + private static final Map<String, Self> selves = new HashMap<String, Self>(); + + /** + * The <tt>ServiceListener</tt> which listens to the <tt>BundleContext</tt> + * in which the <tt>msofficecomm</tt> bundle has been started for service + * changes. + */ + private static final ServiceListener serviceListener + = new ServiceListener() + { + public void serviceChanged(ServiceEvent event) + { + Messenger.serviceChanged(event); + } + }; + + static + { + System.loadLibrary("jmsofficecomm"); + } + + private static void addSelf( + String signinName, + ProtocolProviderService pps, + OperationSetPresence presenceOpSet) + { + Self self = selves.get(signinName); + + if (self == null) + { + self = new Self(signinName); + selves.put(signinName, self); + } + self.addProtocolProviderService(pps, presenceOpSet); + } + + private static String getSigninName( + Contact contact, + ProtocolProviderService pps) + { + String address + = (contact == null) + ? pps.getAccountID().getAccountAddress() + : contact.getAddress(); + String signinName; + + if (address.contains("@")) + { + String protocol = pps.getProtocolName() + ":"; + + if (address.toLowerCase().startsWith(protocol.toLowerCase())) + signinName = address.substring(protocol.length()); + else + signinName = address; + } + else + signinName = null; + return signinName; + } + + static int getStatus(MessengerContact messengerContact) + { + String signinName = messengerContact.signinName; + int presenceStatus; + + if (signinName == null) + presenceStatus = Integer.MIN_VALUE; + else + { + Self self = selves.get(signinName); + + if (self == null) + { + presenceStatus = Integer.MIN_VALUE; + for (Self aSelf : selves.values()) + { + int aPresenceStatus = aSelf.getPresenceStatus(signinName); + + if (presenceStatus < aPresenceStatus) + { + presenceStatus = aPresenceStatus; + if (presenceStatus >= PresenceStatus.MAX_STATUS_VALUE) + break; + } + } + } + else + presenceStatus = self.getPresenceStatus(); + } + + return presenceStatusToMISTATUS(presenceStatus); + } + + static boolean isSelf(MessengerContact messengerContact) + { + String signinName = messengerContact.signinName; + + return (signinName == null) ? false : selves.containsKey(signinName); + } + + private static native void onContactStatusChange( + String signinName, + int status); + + private static int presenceStatusToMISTATUS(int presenceStatus) + { + int mistatus; + + if (presenceStatus == Integer.MIN_VALUE) + mistatus = MISTATUS_UNKNOWN; + else + { + if (presenceStatus < PresenceStatus.ONLINE_THRESHOLD) + mistatus = MISTATUS_OFFLINE; + else if (presenceStatus < PresenceStatus.AWAY_THRESHOLD) + mistatus = MISTATUS_MAY_BE_AVAILABLE; + else if (presenceStatus < PresenceStatus.AVAILABLE_THRESHOLD) + mistatus = MISTATUS_AWAY; + else + mistatus = MISTATUS_ONLINE; + } + return mistatus; + } + + private static void removeSelf( + String signinName, + ProtocolProviderService pps) + { + Self self = selves.get(signinName); + + if ((self != null) && (self.removeProtocolProviderService(pps) < 1)) + selves.remove(signinName); + } + + private static void serviceChanged(ServiceEvent event) + { + Object service = bundleContext.getService(event.getServiceReference()); + + if (service instanceof ProtocolProviderService) + { + ProtocolProviderService pps = (ProtocolProviderService) service; + /* + * The Messenger class implements an integration of Jitsi presence + * into Microsoft Office so the only accounts of interest to it are + * the ones which support presence. + */ + OperationSetPresence presenceOpSet + = pps.getOperationSet(OperationSetPresence.class); + + if (presenceOpSet != null) + { + String signinName = getSigninName(null, pps); + + if (signinName != null) + { + switch (event.getType()) + { + case ServiceEvent.REGISTERED: + addSelf(signinName, pps, presenceOpSet); + break; + case ServiceEvent.UNREGISTERING: + removeSelf(signinName, pps); + break; + } + } + } + } + } + + static void start(BundleContext bundleContext) + throws Exception + { + Messenger.bundleContext = bundleContext; + + bundleContext.addServiceListener(serviceListener); + for (ServiceReference reference + : bundleContext.getServiceReferences( + ProtocolProviderService.class.getName(), + null)) + { + serviceListener.serviceChanged( + new ServiceEvent(ServiceEvent.REGISTERED, reference)); + } + } + + static void stop(BundleContext bundleContext) + throws Exception + { + bundleContext.removeServiceListener(serviceListener); + + Messenger.bundleContext = null; + } + + /** + * Initializes a new <tt>Messenger</tt> instance which is to represent the + * Java counterpart of a native <tt>IMessenger</tt> implementation. + */ + public Messenger() + { + } + + public void startConversation( + final int conversationType, + final String[] participants) + { + SwingUtilities.invokeLater( + new Runnable() + { + public void run() + { + BundleContext bundleContext = Messenger.bundleContext; + + if (bundleContext != null) + { + UIService uiService + = ServiceUtils.getService( + bundleContext, + UIService.class); + + if (uiService != null) + { + switch (conversationType) + { + case CONVERSATION_TYPE_AUDIO: + case CONVERSATION_TYPE_PHONE: + case CONVERSATION_TYPE_PSTN: + uiService.createCall(participants); + break; + case CONVERSATION_TYPE_IM: + uiService.startChat(participants); + break; + } + } + } + } + }); + } + + private static class Self + implements ContactPresenceStatusListener, + ProviderPresenceStatusListener + { + private final Map<ProtocolProviderService, OperationSetPresence> ppss + = new HashMap<ProtocolProviderService, OperationSetPresence>(); + + private int presenceStatus = Integer.MIN_VALUE; + + public final String signinName; + + public Self(String signinName) + { + this.signinName = signinName; + } + + void addProtocolProviderService( + ProtocolProviderService pps, + OperationSetPresence presenceOpSet) + { + if (!ppss.containsKey(pps)) + { + ppss.put(pps, presenceOpSet); + + presenceOpSet.addContactPresenceStatusListener(this); + presenceOpSet.addProviderPresenceStatusListener(this); + providerStatusChanged(null); + } + } + + public void contactPresenceStatusChanged( + ContactPresenceStatusChangeEvent event) + { + String signinName + = getSigninName( + event.getSourceContact(), + event.getSourceProvider()); + + if (signinName != null) + { + PresenceStatus oldStatus = event.getOldStatus(); + + Messenger.onContactStatusChange( + signinName, + presenceStatusToMISTATUS( + (oldStatus == null) + ? Integer.MIN_VALUE + : oldStatus.getStatus())); + } + } + + int getPresenceStatus() + { + return presenceStatus; + } + + int getPresenceStatus(String signinName) + { + int presenceStatus; + + if (this.signinName.equals(signinName)) + presenceStatus = getPresenceStatus(); + else + { + presenceStatus = Integer.MIN_VALUE; + for (OperationSetPresence presenceOpSet : ppss.values()) + { + try + { + Contact contact + = presenceOpSet.findContactByID(signinName); + + if (contact != null) + { + PresenceStatus contactPresenceStatus + = contact.getPresenceStatus(); + + if (contactPresenceStatus != null) + { + int contactStatus + = contactPresenceStatus.getStatus(); + + if (presenceStatus < contactStatus) + { + presenceStatus = contactStatus; + if (presenceStatus + >= PresenceStatus.MAX_STATUS_VALUE) + break; + } + } + } + } + catch (Throwable t) + { + /* + * It does not sound like it makes a lot of sense to + * fail the getting of the presence status of the + * specified signinName just because one of the possibly + * many OperationSetPresence instances has failed. + * Additionally, the native counterpart will swallow any + * Java exception anyway. + */ + if (t instanceof ThreadDeath) + throw (ThreadDeath) t; + else + t.printStackTrace(System.err); + } + } + } + return presenceStatus; + } + + public void providerStatusChanged( + ProviderPresenceStatusChangeEvent event) + { + PresenceStatus presenceStatus = null; + + for (OperationSetPresence presenceOpSet : ppss.values()) + { + PresenceStatus presenceOpSetStatus + = presenceOpSet.getPresenceStatus(); + + if (presenceOpSetStatus != null) + { + if ((presenceStatus == null) + || (presenceStatus.compareTo(presenceOpSetStatus) + < 0)) + presenceStatus = presenceOpSetStatus; + } + } + + setPresenceStatus(presenceStatus); + } + + public void providerStatusMessageChanged(PropertyChangeEvent event) {} + + int removeProtocolProviderService(ProtocolProviderService pps) + { + OperationSetPresence presenceOpSet = ppss.get(pps); + + if (presenceOpSet != null) + { + presenceOpSet.removeContactPresenceStatusListener(this); + presenceOpSet.removeProviderPresenceStatusListener(this); + ppss.remove(pps); + providerStatusChanged(null); + } + return ppss.size(); + } + + private void setPresenceStatus(PresenceStatus presenceStatus) + { + int status + = (presenceStatus == null) + ? Integer.MIN_VALUE + : presenceStatus.getStatus(); + + if (this.presenceStatus != status) + { + int oldValue = this.presenceStatus; + + this.presenceStatus = status; + + Messenger.onContactStatusChange( + signinName, + presenceStatusToMISTATUS(oldValue)); + } + } + } +} diff --git a/src/net/java/sip/communicator/plugin/msofficecomm/MessengerContact.java b/src/net/java/sip/communicator/plugin/msofficecomm/MessengerContact.java new file mode 100644 index 0000000..abf9d15 --- /dev/null +++ b/src/net/java/sip/communicator/plugin/msofficecomm/MessengerContact.java @@ -0,0 +1,60 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.plugin.msofficecomm; + +/** + * Represents the Java counterpart of a native <tt>IMessengerContact</tt> + * implementation. + * + * @author Lyubomir Marinov + */ +public class MessengerContact +{ + /** + * The sign-in name associated with the native <tt>IMessengerContact</tt> + * implementation represented by this instance. + */ + public final String signinName; + + /** + * Initializes a new <tt>MessengerContact</tt> instance which is to + * represent the Java counterpart of a native <tt>IMessengerContact</tt> + * implementation associated with a specific sign-in name. + * + * @param signinName the sign-in name associated with the native + * <tt>IMessengerContact</tt> implementation which is to be represented by + * the new instance + */ + public MessengerContact(String signinName) + { + this.signinName = signinName; + } + + /** + * Gets the connection/presence status of the contact associated with this + * instance in the form of a <tt>MISTATUS</tt> value. + * + * @return a <tt>MISTATUS</tt> value which specifies the connection/presence + * status of the contact associated with this instance + */ + public int getStatus() + { + return Messenger.getStatus(this); + } + + /** + * Gets the indicator which determines whether this + * <tt>MessengerContact</tt> is the same user as the current client user. + * + * @return <tt>true</tt> if this <tt>MessengerContact</tt> is the same user + * as the current client user; otherwise, <tt>false</tt> + */ + public boolean isSelf() + { + return Messenger.isSelf(this); + } +} diff --git a/src/net/java/sip/communicator/plugin/msofficecomm/MsOfficeCommActivator.java b/src/net/java/sip/communicator/plugin/msofficecomm/MsOfficeCommActivator.java new file mode 100644 index 0000000..05bd7cc --- /dev/null +++ b/src/net/java/sip/communicator/plugin/msofficecomm/MsOfficeCommActivator.java @@ -0,0 +1,75 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.plugin.msofficecomm; + +import org.osgi.framework.*; + +/** + * Implements {@link BundleActivator} for the <tt>msofficecomm</tt> bundle. + * + * @author Lyubomir Marinov + */ +public class MsOfficeCommActivator + implements BundleActivator +{ + /** + * Starts the <tt>msofficecomm</tt> bundle in a specific + * {@link BundleContext}. + * + * @param bundleContext the <tt>BundleContext</tt> in which the + * <tt>msofficecomm</tt> bundle is to be started + * @throws Exception if anything goes wrong while starting the + * <tt>msofficecomm</tt> bundle in the specified <tt>BundleContext</tt> + */ + public void start(BundleContext bundleContext) + throws Exception + { + Messenger.start(bundleContext); + + boolean stopMessenger = true; + + try + { + int hresult = OutOfProcessServer.start(); + + if (hresult < 0) + throw new RuntimeException("HRESULT " + hresult); + else + stopMessenger = false; + } + finally + { + if (stopMessenger) + Messenger.stop(bundleContext); + } + } + + /** + * Stops the <tt>msofficecomm</tt> bundle in a specific + * {@link BundleContext}. + * + * @param bundleContext the <tt>BundleContext</tt> in which the + * <tt>msofficecomm</tt> bundle is to be stopped + * @throws Exception if anything goes wrong while stopping the + * <tt>msofficecomm</tt> bundle in the specified <tt>BundleContext</tt> + */ + public void stop(BundleContext bundleContext) + throws Exception + { + try + { + int hresult = OutOfProcessServer.stop(); + + if (hresult < 0) + throw new RuntimeException("HRESULT " + hresult); + } + finally + { + Messenger.stop(bundleContext); + } + } +} diff --git a/src/net/java/sip/communicator/plugin/msofficecomm/OutOfProcessServer.java b/src/net/java/sip/communicator/plugin/msofficecomm/OutOfProcessServer.java new file mode 100644 index 0000000..7947f64 --- /dev/null +++ b/src/net/java/sip/communicator/plugin/msofficecomm/OutOfProcessServer.java @@ -0,0 +1,27 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.plugin.msofficecomm; + +class OutOfProcessServer +{ + static + { + System.loadLibrary("jmsofficecomm"); + } + + static native int start(); + + static native int stop(); + + /** + * Prevents the initialization of a new <tt>OutOfProcessServer</tt> + * instance. + */ + private OutOfProcessServer() + { + } +} diff --git a/src/net/java/sip/communicator/plugin/msofficecomm/msofficecomm.manifest.mf b/src/net/java/sip/communicator/plugin/msofficecomm/msofficecomm.manifest.mf new file mode 100644 index 0000000..1f30939 --- /dev/null +++ b/src/net/java/sip/communicator/plugin/msofficecomm/msofficecomm.manifest.mf @@ -0,0 +1,11 @@ +Bundle-Activator: net.java.sip.communicator.plugin.msofficecomm.MsOfficeCommActivator +Bundle-Description: Microsoft Office Communicator +Bundle-Name: Microsoft Office Communicator +Bundle-Vendor: jitsi.org +Bundle-Version: 0.0.1 +Import-Package: javax.swing, + net.java.sip.communicator.service.gui, + net.java.sip.communicator.service.protocol, + net.java.sip.communicator.service.protocol.event, + net.java.sip.communicator.util, + org.osgi.framework diff --git a/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf b/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf index 7d2106e..2f0b01f 100644 --- a/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf +++ b/src/net/java/sip/communicator/plugin/notificationconfiguration/notificationconfiguration.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.notificationconfiguration.NotificationConfigurationActivator Bundle-Name: Plugin Manager Notification Bundle-Description: Manage all SIP Communicator notification. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/notificationwiring/notificationwiring.manifest.mf b/src/net/java/sip/communicator/plugin/notificationwiring/notificationwiring.manifest.mf index 00d884e..0ad7d44 100644 --- a/src/net/java/sip/communicator/plugin/notificationwiring/notificationwiring.manifest.mf +++ b/src/net/java/sip/communicator/plugin/notificationwiring/notificationwiring.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.notificationwiring.NotificationWiringActivator Bundle-Name: Notification-Wiring Bundle-Description: Wires events from various bundles to the notification service -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/otr/otr.manifest.mf b/src/net/java/sip/communicator/plugin/otr/otr.manifest.mf index edcab21..24aabd8 100644 --- a/src/net/java/sip/communicator/plugin/otr/otr.manifest.mf +++ b/src/net/java/sip/communicator/plugin/otr/otr.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.otr.OtrActivator
Bundle-Name: OTR (Off-the-Record) Messaging
Bundle-Description: Support for secure, Off The Record messaging in SIP Communicator
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/pluginmanager/pluginmanager.manifest.mf b/src/net/java/sip/communicator/plugin/pluginmanager/pluginmanager.manifest.mf index d34c0c7..71cd57e 100644 --- a/src/net/java/sip/communicator/plugin/pluginmanager/pluginmanager.manifest.mf +++ b/src/net/java/sip/communicator/plugin/pluginmanager/pluginmanager.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.pluginmanager.PluginManagerActivator Bundle-Name: Plugin Manager plugin Bundle-Description: Manage all SIP Communicator plugins. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/profiler4j/profiler4j.manifest.mf b/src/net/java/sip/communicator/plugin/profiler4j/profiler4j.manifest.mf index 3b946d6..b817d45 100644 --- a/src/net/java/sip/communicator/plugin/profiler4j/profiler4j.manifest.mf +++ b/src/net/java/sip/communicator/plugin/profiler4j/profiler4j.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.profiler4j.ProfilerActivator Bundle-Name: Integrated profiler plugin Bundle-Description: A bundle that provides profile cpu and memory of the running app. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.apache.commons.logging, diff --git a/src/net/java/sip/communicator/plugin/provisioning/provisioning.manifest.mf b/src/net/java/sip/communicator/plugin/provisioning/provisioning.manifest.mf index ea2d941..8b9305b 100644 --- a/src/net/java/sip/communicator/plugin/provisioning/provisioning.manifest.mf +++ b/src/net/java/sip/communicator/plugin/provisioning/provisioning.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.provisioning.ProvisioningActivator Bundle-Name: Provisioning plugin Bundle-Description: Provisioning -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/reconnectplugin/reconnectplugin.manifest.mf b/src/net/java/sip/communicator/plugin/reconnectplugin/reconnectplugin.manifest.mf index 24d859e..a2b463f 100644 --- a/src/net/java/sip/communicator/plugin/reconnectplugin/reconnectplugin.manifest.mf +++ b/src/net/java/sip/communicator/plugin/reconnectplugin/reconnectplugin.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.reconnectplugin.ReconnectPluginActivator Bundle-Name: ReconnectPlugin Bundle-Description: A bundle that implements the Reconnect Plugin Package. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/rssaccregwizz/rssaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/rssaccregwizz/rssaccregwizz.manifest.mf index 399058b..60c6429 100644 --- a/src/net/java/sip/communicator/plugin/rssaccregwizz/rssaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/rssaccregwizz/rssaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.rssaccregwizz.RssAccRegWizzActivator Bundle-Name: Rss account registration wizard Bundle-Description: Rss account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/securityconfig/securityconfig.manifest.mf b/src/net/java/sip/communicator/plugin/securityconfig/securityconfig.manifest.mf index f23ae03..1fb372e 100644 --- a/src/net/java/sip/communicator/plugin/securityconfig/securityconfig.manifest.mf +++ b/src/net/java/sip/communicator/plugin/securityconfig/securityconfig.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.securityconfig.SecurityConfigActivator Bundle-Name: Security Configuration Form
Bundle-Description: The configuration form for security -Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/simpleaccreg/simpleaccreg.manifest.mf b/src/net/java/sip/communicator/plugin/simpleaccreg/simpleaccreg.manifest.mf index bbde792..242e94f 100644 --- a/src/net/java/sip/communicator/plugin/simpleaccreg/simpleaccreg.manifest.mf +++ b/src/net/java/sip/communicator/plugin/simpleaccreg/simpleaccreg.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.simpleaccreg.SimpleAccountRegistrationActivator Bundle-Name: Simple account registration form Bundle-Description: Simple account registration form. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf index a247f93..d949562 100644 --- a/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/sip2sipaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.sip2sipaccregwizz.Sip2SipAccRegWizzActivator
Bundle-Name: Sip 2 Sip account registration wizard
Bundle-Description: Sip 2 Sip account registration wizard.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package: org.osgi.framework,
diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/sipaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/sipaccregwizz/sipaccregwizz.manifest.mf index a20807b..3c75af4 100644 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/sipaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/sipaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.sipaccregwizz.SIPAccRegWizzActivator Bundle-Name: SIP account registration wizard Bundle-Description: SIP account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-package: net.java.sip.communicator.plugin.sipaccregwizz diff --git a/src/net/java/sip/communicator/plugin/skinmanager/skinmanager.manifest.mf b/src/net/java/sip/communicator/plugin/skinmanager/skinmanager.manifest.mf index 21f7705..bfe0c71 100644 --- a/src/net/java/sip/communicator/plugin/skinmanager/skinmanager.manifest.mf +++ b/src/net/java/sip/communicator/plugin/skinmanager/skinmanager.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.skinmanager.SkinManagerActivator Bundle-Name: Skin Manager plugin Bundle-Description: Manage all SIP Communicator skins. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/skinresourcepack/skinresourcepack.manifest.mf b/src/net/java/sip/communicator/plugin/skinresourcepack/skinresourcepack.manifest.mf index 8d4dfde..d64b306 100644 --- a/src/net/java/sip/communicator/plugin/skinresourcepack/skinresourcepack.manifest.mf +++ b/src/net/java/sip/communicator/plugin/skinresourcepack/skinresourcepack.manifest.mf @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-Activator: net.java.sip.communicator.plugin.skinresourcepack.SkinResourcePack Bundle-Name: Skin Resource Pack Bundle-Description: The plugin offering skin related data. -Bundle-Vendor: sip-communicator.org, Adam Netocny, CircleTech, s.r.o. +Bundle-Vendor: jitsi.org, Adam Netocny, CircleTech, s.r.o. Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/spellcheck/spellCheck.manifest.mf b/src/net/java/sip/communicator/plugin/spellcheck/spellCheck.manifest.mf index cf41de6..aaf6547 100644 --- a/src/net/java/sip/communicator/plugin/spellcheck/spellCheck.manifest.mf +++ b/src/net/java/sip/communicator/plugin/spellcheck/spellCheck.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.spellcheck.SpellCheckActivator Bundle-Name: Spell Checker Bundle-Description: Provides interactive spell checking of messages being composed. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, net.java.sip.communicator.util, diff --git a/src/net/java/sip/communicator/plugin/sshaccregwizz/sshaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/sshaccregwizz/sshaccregwizz.manifest.mf index 2dcc971..f6c650f 100644 --- a/src/net/java/sip/communicator/plugin/sshaccregwizz/sshaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/sshaccregwizz/sshaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.sshaccregwizz.SSHAccRegWizzActivator Bundle-Name: SSH account registration wizard Bundle-Description: SSH account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf b/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf index 5e00896..080d8f9 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf +++ b/src/net/java/sip/communicator/plugin/whiteboard/whiteboard.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.whiteboard.WhiteboardActivator Bundle-Name: Whiteboard plugin Bundle-Description: A whiteboard for SIP-Communicator. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/yahooaccregwizz/yahooaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/yahooaccregwizz/yahooaccregwizz.manifest.mf index 6590ee3..aecb0aa 100644 --- a/src/net/java/sip/communicator/plugin/yahooaccregwizz/yahooaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/yahooaccregwizz/yahooaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.yahooaccregwizz.YahooAccRegWizzActivator Bundle-Name: Yahoo account registration wizard Bundle-Description: Yahoo account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/zeroconfaccregwizz.manifest.mf b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/zeroconfaccregwizz.manifest.mf index c9cb1a0..728fedc 100644 --- a/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/zeroconfaccregwizz.manifest.mf +++ b/src/net/java/sip/communicator/plugin/zeroconfaccregwizz/zeroconfaccregwizz.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.zeroconfaccregwizz.ZeroconfAccRegWizzActivator Bundle-Name: Zeroconf account registration wizard Bundle-Description: Zeroconf account registration wizard. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/service/argdelegation/argdelegation.manifest.mf b/src/net/java/sip/communicator/service/argdelegation/argdelegation.manifest.mf index d665aa5..9888dd8 100644 --- a/src/net/java/sip/communicator/service/argdelegation/argdelegation.manifest.mf +++ b/src/net/java/sip/communicator/service/argdelegation/argdelegation.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: Argument Delegation Service Bundle-Description: A service that allows bundles to register as handlers for specific command line arguments -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.argdelegation diff --git a/src/net/java/sip/communicator/service/contacteventhandler/contact.event.handler.manifest.mf b/src/net/java/sip/communicator/service/contacteventhandler/contact.event.handler.manifest.mf index f272967..281912d 100644 --- a/src/net/java/sip/communicator/service/contacteventhandler/contact.event.handler.manifest.mf +++ b/src/net/java/sip/communicator/service/contacteventhandler/contact.event.handler.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: Contact Event Handler service Bundle-Description: Contact Event Handler service -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/service/contactlist/MetaContactListService.java b/src/net/java/sip/communicator/service/contactlist/MetaContactListService.java index bf2a3c4..39f1284 100644 --- a/src/net/java/sip/communicator/service/contactlist/MetaContactListService.java +++ b/src/net/java/sip/communicator/service/contactlist/MetaContactListService.java @@ -16,7 +16,7 @@ import net.java.sip.communicator.service.protocol.*; * list including contacts from all implemented protocols. * <p> * An implementation of the <tt>MetaContactListService</tt> would take care - * of synchronizing the local copy ot the contact list with the versions stored + * of synchronizing the local copy of the contact list with the versions stored * on the various server protocols. * <p> * All modules that would for some reason like to query or modify the contact @@ -27,7 +27,7 @@ import net.java.sip.communicator.service.protocol.*; * protocol specific contacts so that they represent a single person or identity. * Every protocol specific <tt>Contact</tt> would therefore automatically * be assigned to a corresponding <tt>MetaContact</tt>. A single - * MetaContact may containg multiple contacts (e.g. a single person often + * MetaContact may containing multiple contacts (e.g. a single person often * has accounts in different protocols) while a single protocol specific * Contact may only be assigned to a exactly one MetaContact. * <p> @@ -78,7 +78,7 @@ public interface MetaContactListService /** * Returns the meta contact group that is a direct parent of the specified * <tt>child</tt>. - * @param child the <tt>MetaContactGroup</tt> whose paret group we're + * @param child the <tt>MetaContactGroup</tt> whose parent group we're * looking for. If no parent is found <tt>null</tt> is returned. * * @return the <tt>MetaContactGroup</tt> that contains <tt>child</tt> or @@ -89,7 +89,7 @@ public interface MetaContactListService /** * Returns the meta contact group that is a direct parent of the specified * <tt>child</tt>. If no parent is found <tt>null</tt> is returned. - * @param child the <tt>MetaContact</tt> whose paret group we're looking + * @param child the <tt>MetaContact</tt> whose parent group we're looking * for. * * @return the <tt>MetaContactGroup</tt> that contains <tt>child</tt> or @@ -107,7 +107,7 @@ public interface MetaContactListService * * @param contact the contact whose encapsulating meta contact we're looking * for. - * @return the MetaContact containing the speicified contact or null + * @return the MetaContact containing the specified contact or <tt>null</tt> * if no such contact is present in this contact list. */ public MetaContact findMetaContactByContact(Contact contact); @@ -117,7 +117,7 @@ public interface MetaContactListService * group or null if no such MetaContactGroup was found. * * @param group the group whose encapsulating meta group we're looking for. - * @return the MetaContact containing the speicified contact or null + * @return the MetaContact containing the specified contact or <tt>null</tt> * if no such contact is present in this contact list. */ public MetaContactGroup findMetaContactGroupByContactGroup( @@ -128,8 +128,8 @@ public interface MetaContactListService * Returns the MetaContact that corresponds to the specified metaContactID. * * @param metaContactID a String identifier of a meta contact. - * @return the MetaContact with the speicified string identifier or null - * if no such meta contact was found. + * @return the MetaContact with the specified string identifier or + * <tt>null</tt> if no such meta contact was found. */ public MetaContact findMetaContactByMetaUID(String metaContactID); @@ -258,7 +258,7 @@ public interface MetaContactListService /** * First makes the specified protocol provider create a contact * corresponding to the specified <tt>contactID</tt>, then creates a new - * MetaContact which will encapsulate the newly crated protocol specific + * MetaContact which will encapsulate the newly-created protocol specific * contact. Depending on implementations the method may sometimes need * time to complete as it may be necessary for an underlying protocol to * wait for a server to acknowledge addition of the contact. diff --git a/src/net/java/sip/communicator/service/contactlist/contactlist.manifest.mf b/src/net/java/sip/communicator/service/contactlist/contactlist.manifest.mf index 604ebd8..065d055 100755 --- a/src/net/java/sip/communicator/service/contactlist/contactlist.manifest.mf +++ b/src/net/java/sip/communicator/service/contactlist/contactlist.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: Contactlist Service Interfaces Bundle-Description: Contactlist Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/service/contactsource/contactsource.manifest.mf b/src/net/java/sip/communicator/service/contactsource/contactsource.manifest.mf index cbb4aa2..7b06df7 100644 --- a/src/net/java/sip/communicator/service/contactsource/contactsource.manifest.mf +++ b/src/net/java/sip/communicator/service/contactsource/contactsource.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: Contact Source Service Interfaces Bundle-Description: ContactSource Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/service/gui/UIService.java b/src/net/java/sip/communicator/service/gui/UIService.java index 111c474..d1cbf81 100644 --- a/src/net/java/sip/communicator/service/gui/UIService.java +++ b/src/net/java/sip/communicator/service/gui/UIService.java @@ -47,6 +47,7 @@ import net.java.sip.communicator.service.gui.event.*; * @author Yana Stamcheva * @author Dmitri Melnikov * @author Adam Netocny + * @author Lyubomir Marinov */ public interface UIService { @@ -438,4 +439,8 @@ public interface UIService * to runtime apply a skin and refresh automatically the user interface. */ public void repaintUI(); + + public void createCall(String[] participants); + + public void startChat(String[] participants); }
\ No newline at end of file diff --git a/src/net/java/sip/communicator/service/gui/gui.manifest.mf b/src/net/java/sip/communicator/service/gui/gui.manifest.mf index e35b3ec..6203f68 100644 --- a/src/net/java/sip/communicator/service/gui/gui.manifest.mf +++ b/src/net/java/sip/communicator/service/gui/gui.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.service.gui.internal.GuiServiceActivator Bundle-Name: UI Service Bundle-Description: The User Interface Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/service/httputil/httputil.manifest.mf b/src/net/java/sip/communicator/service/httputil/httputil.manifest.mf index c4416c3..b3850e9 100644 --- a/src/net/java/sip/communicator/service/httputil/httputil.manifest.mf +++ b/src/net/java/sip/communicator/service/httputil/httputil.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.service.httputil.HttpUtilActivator Bundle-Name: SIP Communicator Http Utility Packages Bundle-Description: A bundle that export packages with http utility classes. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.xml.sax, diff --git a/src/net/java/sip/communicator/service/ldap/ldap.manifest.mf b/src/net/java/sip/communicator/service/ldap/ldap.manifest.mf index 25e8675..1289e05 100644 --- a/src/net/java/sip/communicator/service/ldap/ldap.manifest.mf +++ b/src/net/java/sip/communicator/service/ldap/ldap.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: LDAP Service Implementation Bundle-Description: LDAP Service Implementation. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 Import-Package: org.osgi.framework, javax.naming.directory, diff --git a/src/net/java/sip/communicator/service/notification/notification.manifest.mf b/src/net/java/sip/communicator/service/notification/notification.manifest.mf index 33106a4..8a0240d 100644 --- a/src/net/java/sip/communicator/service/notification/notification.manifest.mf +++ b/src/net/java/sip/communicator/service/notification/notification.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.service.notification.NotificationServiceActivator Bundle-Name: Notifications Bundle-Description: An implementation of the Notification service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.notification, diff --git a/src/net/java/sip/communicator/service/protocol/PresenceStatus.java b/src/net/java/sip/communicator/service/protocol/PresenceStatus.java index 4d8d966..f4b7a9e 100644 --- a/src/net/java/sip/communicator/service/protocol/PresenceStatus.java +++ b/src/net/java/sip/communicator/service/protocol/PresenceStatus.java @@ -194,7 +194,7 @@ public class PresenceStatus */ public int compareTo(PresenceStatus target) throws ClassCastException, - NullPointerException + NullPointerException { return (getStatus() - target.getStatus()); } diff --git a/src/net/java/sip/communicator/service/protocol/media/protocol.media.manifest.mf b/src/net/java/sip/communicator/service/protocol/media/protocol.media.manifest.mf index c855c6f..8f640cb 100644 --- a/src/net/java/sip/communicator/service/protocol/media/protocol.media.manifest.mf +++ b/src/net/java/sip/communicator/service/protocol/media/protocol.media.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.service.protocol.media.ProtocolMediaActivator Bundle-Name: Media Utilities for the Protocol Provider Service Bundle-Description: Media Utilities for the Protocol Provider Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/service/protocol/protocol.provider.manifest.mf b/src/net/java/sip/communicator/service/protocol/protocol.provider.manifest.mf index 775a2ab..00a5c74 100644 --- a/src/net/java/sip/communicator/service/protocol/protocol.provider.manifest.mf +++ b/src/net/java/sip/communicator/service/protocol/protocol.provider.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.service.protocol.ProtocolProviderActivator Bundle-Name: Protocol Provider Service Bundle-Description: Protocol Provider Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/service/provdisc/provdisc.manifest.mf b/src/net/java/sip/communicator/service/provdisc/provdisc.manifest.mf index 69e9d6c..8790e7d 100644 --- a/src/net/java/sip/communicator/service/provdisc/provdisc.manifest.mf +++ b/src/net/java/sip/communicator/service/provdisc/provdisc.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: Provisioning Discovery Service Bundle-Description: Provisioning Discovery Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.provdisc, diff --git a/src/net/java/sip/communicator/service/replacement/replacement.manifest.mf b/src/net/java/sip/communicator/service/replacement/replacement.manifest.mf index 28053f1..c580e7e 100644 --- a/src/net/java/sip/communicator/service/replacement/replacement.manifest.mf +++ b/src/net/java/sip/communicator/service/replacement/replacement.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: Replacement Service Bundle-Description: Replacement Service. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.replacement, diff --git a/src/net/java/sip/communicator/service/version/version.manifest.mf b/src/net/java/sip/communicator/service/version/version.manifest.mf index 26352b5..6183ebf 100755 --- a/src/net/java/sip/communicator/service/version/version.manifest.mf +++ b/src/net/java/sip/communicator/service/version/version.manifest.mf @@ -1,6 +1,6 @@ Bundle-Name: Version Service Implementation Bundle-Description: Version Service Implementation. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Export-Package: net.java.sip.communicator.service.version diff --git a/src/net/java/sip/communicator/util/dns/util.dns.manifest.mf b/src/net/java/sip/communicator/util/dns/util.dns.manifest.mf index 1ec80b3..dbbdaec 100644 --- a/src/net/java/sip/communicator/util/dns/util.dns.manifest.mf +++ b/src/net/java/sip/communicator/util/dns/util.dns.manifest.mf @@ -2,7 +2,7 @@ Bundle-Activator: net.java.sip.communicator.util.dns.DnsUtilActivator Bundle-Name: SIP Communicator DNS Utility Packages
Bundle-SymbolicName: net.java.sip.communicator.util.dns
Bundle-Description: A bundle that export packages with DNS utility classes.
-Bundle-Vendor: sip-communicator.org
+Bundle-Vendor: jitsi.org
Bundle-Version: 0.0.1
System-Bundle: yes
Import-Package:
diff --git a/src/net/java/sip/communicator/util/util.manifest.mf b/src/net/java/sip/communicator/util/util.manifest.mf index 8e980fc..2189026 100644 --- a/src/net/java/sip/communicator/util/util.manifest.mf +++ b/src/net/java/sip/communicator/util/util.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.util.UtilActivator Bundle-Name: SIP Communicator Utility Packages Bundle-Description: A bundle that export packages with utility classes. -Bundle-Vendor: sip-communicator.org +Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.xml.sax, |