summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-12 13:12:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-12 13:12:52 +0000
commit70dc611c18f94358749c6aa682ebaaa34ca44d18 (patch)
tree0d2c90eda0c7fff9d483480e5781d46fef395c87 /src
parentd91ea9f58d10af27c06aaffb77c2ac7f436cf7ff (diff)
more naming conflicts resolved
git-svn-id: http://svn.miranda-ng.org/main/trunk@14924 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/BaseExtraIcon.cpp31
-rw-r--r--src/mir_app/src/CallbackExtraIcon.cpp14
-rw-r--r--src/mir_app/src/ExtraIcon.cpp16
-rw-r--r--src/mir_app/src/ExtraIcon.h34
-rw-r--r--src/mir_app/src/ExtraIconGroup.cpp113
-rw-r--r--src/mir_app/src/IcolibExtraIcon.cpp14
-rw-r--r--src/mir_app/src/chat_clist.cpp14
-rw-r--r--src/mir_app/src/chat_log.cpp33
-rw-r--r--src/mir_app/src/chat_manager.cpp380
-rw-r--r--src/mir_app/src/chat_opts.cpp18
-rw-r--r--src/mir_app/src/chat_svc.cpp231
-rw-r--r--src/mir_app/src/chat_tools.cpp136
-rw-r--r--src/mir_app/src/clistevents.cpp2
-rw-r--r--src/mir_app/src/colorchooser.cpp2
-rw-r--r--src/mir_app/src/extraicons.cpp32
-rw-r--r--src/mir_app/src/miranda.h4
-rw-r--r--src/mir_app/src/options_ei.cpp10
-rw-r--r--src/mir_app/src/services.cpp24
-rw-r--r--src/mir_app/src/sounds.cpp6
19 files changed, 559 insertions, 555 deletions
diff --git a/src/mir_app/src/BaseExtraIcon.cpp b/src/mir_app/src/BaseExtraIcon.cpp
index 2de3a6874c..3357624759 100644
--- a/src/mir_app/src/BaseExtraIcon.cpp
+++ b/src/mir_app/src/BaseExtraIcon.cpp
@@ -24,9 +24,12 @@ Boston, MA 02111-1307, USA.
#include "extraicons.h"
BaseExtraIcon::BaseExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon, MIRANDAHOOKPARAM OnClick, LPARAM param) :
- ExtraIcon(name), id(id), OnClick(OnClick), onClickParam(param),
- tszDescription(mir_tstrdup(description)),
- szDescIcon(mir_strdup(descIcon))
+ ExtraIcon(name),
+ m_id(id),
+ m_OnClick(OnClick),
+ m_onClickParam(param),
+ m_tszDescription(mir_tstrdup(description)),
+ m_szDescIcon(mir_strdup(descIcon))
{
}
@@ -36,45 +39,45 @@ BaseExtraIcon::~BaseExtraIcon()
void BaseExtraIcon::setOnClick(MIRANDAHOOKPARAM pFunc, LPARAM pParam)
{
- OnClick = pFunc;
- onClickParam = pParam;
+ m_OnClick = pFunc;
+ m_onClickParam = pParam;
}
int BaseExtraIcon::getID() const
{
- return id;
+ return m_id;
}
const TCHAR* BaseExtraIcon::getDescription() const
{
- return tszDescription;
+ return m_tszDescription;
}
void BaseExtraIcon::setDescription(const TCHAR *desc)
{
- tszDescription = mir_tstrdup(desc);
+ m_tszDescription = mir_tstrdup(desc);
}
const char* BaseExtraIcon::getDescIcon() const
{
- return szDescIcon;
+ return m_szDescIcon;
}
void BaseExtraIcon::setDescIcon(const char *icon)
{
- szDescIcon = mir_strdup(icon);
+ m_szDescIcon = mir_strdup(icon);
}
void BaseExtraIcon::onClick(MCONTACT hContact)
{
- if (OnClick != NULL)
- OnClick(hContact, (LPARAM)ConvertToClistSlot(slot), onClickParam);
+ if (m_OnClick != NULL)
+ m_OnClick(hContact, (LPARAM)ConvertToClistSlot(m_slot), m_onClickParam);
}
int BaseExtraIcon::ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage)
{
- ExtraIcon *tmp = extraIconsByHandle[id - 1];
+ ExtraIcon *tmp = extraIconsByHandle[m_id - 1];
if (tmp != this)
return tmp->ClistSetExtraIcon(hContact, hImage);
- return Clist_SetExtraIcon(hContact, slot, hImage);
+ return Clist_SetExtraIcon(hContact, m_slot, hImage);
}
diff --git a/src/mir_app/src/CallbackExtraIcon.cpp b/src/mir_app/src/CallbackExtraIcon.cpp
index a4f04b22a7..d896452a9a 100644
--- a/src/mir_app/src/CallbackExtraIcon.cpp
+++ b/src/mir_app/src/CallbackExtraIcon.cpp
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA.
CallbackExtraIcon::CallbackExtraIcon(int _id, const char *_name, const TCHAR *_description, const char *_descIcon,
MIRANDAHOOK _RebuildIcons, MIRANDAHOOK _ApplyIcon, MIRANDAHOOKPARAM _OnClick, LPARAM _param) :
BaseExtraIcon(_id, _name, _description, _descIcon, _OnClick, _param),
- RebuildIcons(_RebuildIcons), ApplyIcon(_ApplyIcon), needToRebuild(true)
+ m_pfnRebuildIcons(_RebuildIcons), m_pfnApplyIcon(_ApplyIcon), m_needToRebuild(true)
{
}
@@ -42,12 +42,12 @@ int CallbackExtraIcon::getType() const
void CallbackExtraIcon::rebuildIcons()
{
if (!isEnabled()) {
- needToRebuild = true;
+ m_needToRebuild = true;
return;
}
- needToRebuild = false;
- RebuildIcons(0, 0);
+ m_needToRebuild = false;
+ m_pfnRebuildIcons(0, 0);
}
void CallbackExtraIcon::applyIcon(MCONTACT hContact)
@@ -55,15 +55,15 @@ void CallbackExtraIcon::applyIcon(MCONTACT hContact)
if (!isEnabled() || hContact == NULL)
return;
- if (needToRebuild)
+ if (m_needToRebuild)
rebuildIcons();
- ApplyIcon(hContact, 0);
+ m_pfnApplyIcon(hContact, 0);
}
int CallbackExtraIcon::setIcon(int id, MCONTACT hContact, HANDLE icon)
{
- if (!isEnabled() || hContact == NULL || id != this->id)
+ if (!isEnabled() || hContact == NULL || id != m_id)
return -1;
return ClistSetExtraIcon(hContact, icon);
diff --git a/src/mir_app/src/ExtraIcon.cpp b/src/mir_app/src/ExtraIcon.cpp
index 166f337383..5c468cbfc2 100644
--- a/src/mir_app/src/ExtraIcon.cpp
+++ b/src/mir_app/src/ExtraIcon.cpp
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.
#include "extraicons.h"
ExtraIcon::ExtraIcon(const char *name) :
- szName(mir_strdup(name)), slot(-1), position(1000), hLangpack(0)
+ m_szName(mir_strdup(name)), m_slot(-1), m_position(1000), m_hLangpack(0)
{
}
@@ -34,32 +34,32 @@ ExtraIcon::~ExtraIcon()
const char *ExtraIcon::getName() const
{
- return szName;
+ return m_szName;
}
int ExtraIcon::getSlot() const
{
- return slot;
+ return m_slot;
}
void ExtraIcon::setSlot(int slot)
{
- this->slot = slot;
+ m_slot = slot;
}
int ExtraIcon::getPosition() const
{
- return position;
+ return m_position;
}
void ExtraIcon::setPosition(int position)
{
- this->position = position;
+ m_position = position;
}
bool ExtraIcon::isEnabled() const
{
- return slot >= 0;
+ return m_slot >= 0;
}
void ExtraIcon::applyIcons()
@@ -69,7 +69,7 @@ void ExtraIcon::applyIcons()
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
// Clear to assert that it will be cleared
- Clist_SetExtraIcon(hContact, slot, INVALID_HANDLE_VALUE);
+ Clist_SetExtraIcon(hContact, m_slot, INVALID_HANDLE_VALUE);
applyIcon(hContact);
}
}
diff --git a/src/mir_app/src/ExtraIcon.h b/src/mir_app/src/ExtraIcon.h
index b5c8c1e617..797d098dcb 100644
--- a/src/mir_app/src/ExtraIcon.h
+++ b/src/mir_app/src/ExtraIcon.h
@@ -35,7 +35,7 @@ public:
virtual void rebuildIcons() = 0;
virtual void applyIcons();
- virtual void applyIcon(MCONTACT hContact) =0 ;
+ virtual void applyIcon(MCONTACT hContact) = 0;
virtual void onClick(MCONTACT hContact) = 0;
virtual int setIcon(int id, MCONTACT hContact, HANDLE icon) = 0;
@@ -57,13 +57,13 @@ public:
virtual int ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage) = 0;
- int hLangpack;
+ int m_hLangpack;
protected:
- ptrA szName;
+ ptrA m_szName;
- int slot;
- int position;
+ int m_slot;
+ int m_position;
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -88,11 +88,11 @@ public:
virtual int ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage);
protected:
- int id;
- ptrT tszDescription;
- ptrA szDescIcon;
- MIRANDAHOOKPARAM OnClick;
- LPARAM onClickParam;
+ int m_id;
+ ptrT m_tszDescription;
+ ptrA m_szDescIcon;
+ MIRANDAHOOKPARAM m_OnClick;
+ LPARAM m_onClickParam;
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -114,10 +114,10 @@ public:
virtual int setIconByName(int id, MCONTACT hContact, const char* icon);
private:
- int(*RebuildIcons)(WPARAM wParam, LPARAM lParam);
- int(*ApplyIcon)(WPARAM wParam, LPARAM lParam);
+ int (*m_pfnRebuildIcons)(WPARAM wParam, LPARAM lParam);
+ int (*m_pfnApplyIcon)(WPARAM wParam, LPARAM lParam);
- bool needToRebuild;
+ bool m_needToRebuild;
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -165,14 +165,14 @@ public:
virtual int getPosition() const;
virtual void setSlot(int slot);
- LIST<BaseExtraIcon> items;
+ LIST<BaseExtraIcon> m_items;
virtual int ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage);
protected:
- ptrT tszDescription;
- bool setValidExtraIcon;
- bool insideApply;
+ ptrT m_tszDescription;
+ bool m_setValidExtraIcon;
+ bool m_insideApply;
virtual ExtraIcon *getCurrentItem(MCONTACT hContact) const;
};
diff --git a/src/mir_app/src/ExtraIconGroup.cpp b/src/mir_app/src/ExtraIconGroup.cpp
index d8e4c0974d..088e5d0d7f 100644
--- a/src/mir_app/src/ExtraIconGroup.cpp
+++ b/src/mir_app/src/ExtraIconGroup.cpp
@@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA.
#include "extraicons.h"
ExtraIconGroup::ExtraIconGroup(const char *_name) :
- ExtraIcon(_name), setValidExtraIcon(false), insideApply(false),
- items(1)
+ ExtraIcon(_name), m_setValidExtraIcon(false), m_insideApply(false),
+ m_items(1)
{
db_set_resident(MODULE_NAME, _name);
}
@@ -36,22 +36,22 @@ ExtraIconGroup::~ExtraIconGroup()
void ExtraIconGroup::addExtraIcon(BaseExtraIcon *extra)
{
- items.insert(extra);
+ m_items.insert(extra);
CMString description;
- for (int i = 0; i < items.getCount(); i++) {
+ for (int i = 0; i < m_items.getCount(); i++) {
if (i > 0)
description += _T(" / ");
- description += items[i]->getDescription();
+ description += m_items[i]->getDescription();
}
- tszDescription = mir_tstrdup(description);
+ m_tszDescription = mir_tstrdup(description);
}
void ExtraIconGroup::rebuildIcons()
{
- for (int i = 0; i < items.getCount(); i++)
- items[i]->rebuildIcons();
+ for (int i = 0; i < m_items.getCount(); i++)
+ m_items[i]->rebuildIcons();
}
void ExtraIconGroup::applyIcon(MCONTACT hContact)
@@ -59,27 +59,26 @@ void ExtraIconGroup::applyIcon(MCONTACT hContact)
if (!isEnabled() || hContact == NULL)
return;
- setValidExtraIcon = false;
-
- insideApply = true;
+ m_setValidExtraIcon = false;
+ m_insideApply = true;
int i;
- for (i = 0; i < items.getCount(); i++) {
- items[i]->applyIcon(hContact);
- if (setValidExtraIcon)
+ for (i = 0; i < m_items.getCount(); i++) {
+ m_items[i]->applyIcon(hContact);
+ if (m_setValidExtraIcon)
break;
}
- insideApply = false;
+ m_insideApply = false;
- db_set_dw(hContact, MODULE_NAME, szName, setValidExtraIcon ? items[i]->getID() : 0);
+ db_set_dw(hContact, MODULE_NAME, m_szName, m_setValidExtraIcon ? m_items[i]->getID() : 0);
}
int ExtraIconGroup::getPosition() const
{
int pos = INT_MAX;
- for (int i = 0; i < items.getCount(); i++)
- pos = MIN(pos, items[i]->getPosition());
+ for (int i = 0; i < m_items.getCount(); i++)
+ pos = MIN(pos, m_items[i]->getPosition());
return pos;
}
@@ -87,19 +86,19 @@ void ExtraIconGroup::setSlot(int slot)
{
ExtraIcon::setSlot(slot);
- for (int i = 0; i < items.getCount(); i++)
- items[i]->setSlot(slot);
+ for (int i = 0; i < m_items.getCount(); i++)
+ m_items[i]->setSlot(slot);
}
ExtraIcon * ExtraIconGroup::getCurrentItem(MCONTACT hContact) const
{
- int id = (int)db_get_dw(hContact, MODULE_NAME, szName, 0);
+ int id = (int)db_get_dw(hContact, MODULE_NAME, m_szName, 0);
if (id < 1)
return NULL;
- for (int i = 0; i < items.getCount(); i++)
- if (id == items[i]->getID())
- return items[i];
+ for (int i = 0; i < m_items.getCount(); i++)
+ if (id == m_items[i]->getID())
+ return m_items[i];
return NULL;
}
@@ -123,82 +122,82 @@ int ExtraIconGroup::setIconByName(int id, MCONTACT hContact, const char *value)
int ExtraIconGroup::internalSetIcon(int id, MCONTACT hContact, void *value, bool bByName)
{
- if (insideApply) {
- for (int i=0; i < items.getCount(); i++)
- if (items[i]->getID() == id) {
+ if (m_insideApply) {
+ for (int i=0; i < m_items.getCount(); i++)
+ if (m_items[i]->getID() == id) {
if (bByName)
- return items[i]->setIconByName(id, hContact, (const char*)value);
- return items[i]->setIcon(id, hContact, (HANDLE)value);
+ return m_items[i]->setIconByName(id, hContact, (const char*)value);
+ return m_items[i]->setIcon(id, hContact, (HANDLE)value);
}
return -1;
}
ExtraIcon *current = getCurrentItem(hContact);
- int currentPos = items.getCount();
- int storePos = items.getCount();
- for (int i=0; i < items.getCount(); i++) {
- if (items[i]->getID() == id)
+ int currentPos = m_items.getCount();
+ int storePos = m_items.getCount();
+ for (int i=0; i < m_items.getCount(); i++) {
+ if (m_items[i]->getID() == id)
storePos = i;
- if (items[i] == current)
+ if (m_items[i] == current)
currentPos = i;
}
- if (storePos == items.getCount())
+ if (storePos == m_items.getCount())
return -1;
if (storePos > currentPos) {
- items[storePos]->storeIcon(hContact, value);
+ m_items[storePos]->storeIcon(hContact, value);
return 0;
}
// Ok, we have to set the icon, but we have to assert it is a valid icon
- setValidExtraIcon = false;
+ m_setValidExtraIcon = false;
int ret;
if (bByName)
- ret = items[storePos]->setIconByName(id, hContact, (const char*)value);
+ ret = m_items[storePos]->setIconByName(id, hContact, (const char*)value);
else
- ret = items[storePos]->setIcon(id, hContact, (HANDLE)value);
+ ret = m_items[storePos]->setIcon(id, hContact, (HANDLE)value);
if (storePos < currentPos) {
- if (setValidExtraIcon)
- db_set_dw(hContact, MODULE_NAME, szName, items[storePos]->getID());
+ if (m_setValidExtraIcon)
+ db_set_dw(hContact, MODULE_NAME, m_szName, m_items[storePos]->getID());
}
else if (storePos == currentPos) {
- if (!setValidExtraIcon) {
- db_set_dw(hContact, MODULE_NAME, szName, 0);
+ if (!m_setValidExtraIcon) {
+ db_set_dw(hContact, MODULE_NAME, m_szName, 0);
- insideApply = true;
+ m_insideApply = true;
- for (++storePos; storePos < items.getCount(); ++storePos) {
- items[storePos]->applyIcon(hContact);
- if (setValidExtraIcon)
+ for (++storePos; storePos < m_items.getCount(); ++storePos) {
+ m_items[storePos]->applyIcon(hContact);
+ if (m_setValidExtraIcon)
break;
}
- insideApply = false;
+ m_insideApply = false;
- if (setValidExtraIcon && storePos < items.getCount())
- db_set_dw(hContact, MODULE_NAME, szName, items[storePos]->getID());
+ if (m_setValidExtraIcon && storePos < m_items.getCount())
+ db_set_dw(hContact, MODULE_NAME, m_szName, m_items[storePos]->getID());
}
}
return ret;
}
-const TCHAR *ExtraIconGroup::getDescription() const
+const TCHAR* ExtraIconGroup::getDescription() const
{
- return tszDescription;
+ return m_tszDescription;
}
const char *ExtraIconGroup::getDescIcon() const
{
- for (int i = 0; i < items.getCount(); i++)
- if (!IsEmpty(items[i]->getDescIcon()))
- return items[i]->getDescIcon();
+ for (int i = 0; i < m_items.getCount(); i++)
+ if (!IsEmpty(m_items[i]->getDescIcon()))
+ return m_items[i]->getDescIcon();
return "";
}
@@ -211,7 +210,7 @@ int ExtraIconGroup::getType() const
int ExtraIconGroup::ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage)
{
if (hImage != INVALID_HANDLE_VALUE)
- setValidExtraIcon = true;
+ m_setValidExtraIcon = true;
- return Clist_SetExtraIcon(hContact, slot, hImage);
+ return Clist_SetExtraIcon(hContact, m_slot, hImage);
}
diff --git a/src/mir_app/src/IcolibExtraIcon.cpp b/src/mir_app/src/IcolibExtraIcon.cpp
index cdcd5a3d4a..7c8056386c 100644
--- a/src/mir_app/src/IcolibExtraIcon.cpp
+++ b/src/mir_app/src/IcolibExtraIcon.cpp
@@ -53,7 +53,7 @@ void IcolibExtraIcon::applyIcon(MCONTACT hContact)
HANDLE hImage = INVALID_HANDLE_VALUE;
- ptrA szIconName(db_get_sa(hContact, MODULE_NAME, szName));
+ ptrA szIconName(db_get_sa(hContact, MODULE_NAME, m_szName));
if (!IsEmpty(szIconName))
hImage = GetIcon(szIconName);
@@ -62,14 +62,14 @@ void IcolibExtraIcon::applyIcon(MCONTACT hContact)
int IcolibExtraIcon::setIcon(int id, MCONTACT hContact, HANDLE hIcoLib)
{
- if (hContact == NULL || id != this->id)
+ if (hContact == NULL || id != m_id)
return -1;
if (hIcoLib == INVALID_HANDLE_VALUE)
hIcoLib = NULL;
if (isEnabled()) {
- ptrA szIconName(db_get_sa(hContact, MODULE_NAME, szName));
+ ptrA szIconName(db_get_sa(hContact, MODULE_NAME, m_szName));
if (!IsEmpty(szIconName))
RemoveIcon(szIconName);
}
@@ -86,14 +86,14 @@ int IcolibExtraIcon::setIcon(int id, MCONTACT hContact, HANDLE hIcoLib)
int IcolibExtraIcon::setIconByName(int id, MCONTACT hContact, const char *icon)
{
- if (hContact == NULL || id != this->id)
+ if (hContact == NULL || id != m_id)
return -1;
if (icon == INVALID_HANDLE_VALUE)
icon = NULL;
if (isEnabled()) {
- ptrA szIconName(db_get_sa(hContact, MODULE_NAME, szName));
+ ptrA szIconName(db_get_sa(hContact, MODULE_NAME, m_szName));
if (!IsEmpty(szIconName))
RemoveIcon(szIconName);
}
@@ -113,7 +113,7 @@ void IcolibExtraIcon::storeIcon(MCONTACT hContact, void *icon)
const char *icolibName = (const char *)icon;
if (IsEmpty(icolibName))
- db_unset(hContact, MODULE_NAME, szName);
+ db_unset(hContact, MODULE_NAME, m_szName);
else
- db_set_s(hContact, MODULE_NAME, szName, icolibName);
+ db_set_s(hContact, MODULE_NAME, m_szName, icolibName);
}
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp
index e81520f679..24c7bba5c1 100644
--- a/src/mir_app/src/chat_clist.cpp
+++ b/src/mir_app/src/chat_clist.cpp
@@ -42,7 +42,7 @@ MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDi
}
}
- MCONTACT hContact = ci.FindRoom(pszModule, pszRoom);
+ MCONTACT hContact = chatApi.FindRoom(pszModule, pszRoom);
if (hContact) { //contact exist, make sure it is in the right group
if (pszGroup[0]) {
ptrT grpName(db_get_tsa(hContact, "CList", "Group"));
@@ -87,7 +87,7 @@ BOOL SetAllOffline(BOOL, const char *pszModule)
{
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
- if (!ci.MM_FindModule(szProto))
+ if (!chatApi.MM_FindModule(szProto))
continue;
if (pszModule && mir_strcmp(pszModule, szProto))
continue;
@@ -107,7 +107,7 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM)
return 0;
char *szProto = GetContactProto(hContact);
- if (ci.MM_FindModule(szProto) == NULL)
+ if (chatApi.MM_FindModule(szProto) == NULL)
return 0;
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
@@ -116,7 +116,7 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM)
if (roomid == NULL)
return 0;
- SESSION_INFO *si = ci.SM_FindSession(roomid, szProto);
+ SESSION_INFO *si = chatApi.SM_FindSession(roomid, szProto);
if (si) {
// is the "toggle visibility option set, so we need to close the window?
if (si->hWnd != NULL &&
@@ -124,11 +124,11 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM)
!CallService(MS_CLIST_GETEVENT, hContact, 0) &&
IsWindowVisible(si->hWnd) && !IsIconic(si->hWnd))
{
- if (ci.OnDblClickSession)
- ci.OnDblClickSession(si);
+ if (chatApi.OnDblClickSession)
+ chatApi.OnDblClickSession(si);
return 1;
}
- ci.ShowRoom(si, WINDOW_VISIBLE, TRUE);
+ chatApi.ShowRoom(si, WINDOW_VISIBLE, TRUE);
}
return 1;
}
diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp
index f3ac0e6a4b..f238fd4217 100644
--- a/src/mir_app/src/chat_log.cpp
+++ b/src/mir_app/src/chat_log.cpp
@@ -322,7 +322,7 @@ TCHAR* MakeTimeStamp(TCHAR *pszStamp, time_t time)
char* Log_CreateRTF(LOGSTREAMDATA *streamData)
{
- MODULEINFO *mi = ci.MM_FindModule(streamData->si->pszModule);
+ MODULEINFO *mi = chatApi.MM_FindModule(streamData->si->pszModule);
// guesstimate amount of memory for the RTF
size_t bufferEnd = 0, bufferAlloced = streamData->bRedraw ? 1024 * (streamData->si->iEventCount + 2) : 2048;
@@ -358,18 +358,18 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
}
if (g_Settings->bTimeStampEventColour) {
- LOGFONT &lf = ci.aFonts[0].lf;
+ LOGFONT &lf = chatApi.aFonts[0].lf;
// colored timestamps
static char szStyle[256];
if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) {
int iii = lin->bIsHighlighted ? 16 : (lin->bIsMe ? 2 : 1);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / ci.logPixelSY);
+ mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY);
Log_Append(buffer, bufferEnd, bufferAlloced, "%s ", szStyle);
}
else {
int iii = lin->bIsHighlighted ? 16 : EventToIndex(lin);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / ci.logPixelSY);
+ mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\fs%u", iii + 1, lf.lfWeight >= FW_BOLD ? 1 : 0, lf.lfItalic, 2 * abs(lf.lfHeight) * 74 / chatApi.logPixelSY);
Log_Append(buffer, bufferEnd, bufferAlloced, "%s ", szStyle);
}
}
@@ -430,8 +430,8 @@ char* Log_CreateRtfHeader(MODULEINFO *mi)
// get the number of pixels per logical inch
HDC hdc = GetDC(NULL);
- ci.logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
- ci.logPixelSX = GetDeviceCaps(hdc, LOGPIXELSX);
+ chatApi.logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
+ chatApi.logPixelSX = GetDeviceCaps(hdc, LOGPIXELSX);
ReleaseDC(NULL, hdc);
// ### RTF HEADER
@@ -439,13 +439,13 @@ char* Log_CreateRtfHeader(MODULEINFO *mi)
// font table
Log_Append(buffer, bufferEnd, bufferAlloced, "{\\rtf1\\ansi\\deff0{\\fonttbl");
for (i = 0; i < OPTIONS_FONTCOUNT; i++)
- Log_Append(buffer, bufferEnd, bufferAlloced, "{\\f%u\\fnil\\fcharset%u%S;}", i, ci.aFonts[i].lf.lfCharSet, ci.aFonts[i].lf.lfFaceName);
+ Log_Append(buffer, bufferEnd, bufferAlloced, "{\\f%u\\fnil\\fcharset%u%S;}", i, chatApi.aFonts[i].lf.lfCharSet, chatApi.aFonts[i].lf.lfFaceName);
// colour table
Log_Append(buffer, bufferEnd, bufferAlloced, "}{\\colortbl ;");
for (i = 0; i < OPTIONS_FONTCOUNT; i++)
- Log_Append(buffer, bufferEnd, bufferAlloced, "\\red%u\\green%u\\blue%u;", GetRValue(ci.aFonts[i].color), GetGValue(ci.aFonts[i].color), GetBValue(ci.aFonts[i].color));
+ Log_Append(buffer, bufferEnd, bufferAlloced, "\\red%u\\green%u\\blue%u;", GetRValue(chatApi.aFonts[i].color), GetGValue(chatApi.aFonts[i].color), GetBValue(chatApi.aFonts[i].color));
for (i = 0; i < mi->nColorCount; i++)
Log_Append(buffer, bufferEnd, bufferAlloced, "\\red%u\\green%u\\blue%u;", GetRValue(mi->crColors[i]), GetGValue(mi->crColors[i]), GetBValue(mi->crColors[i]));
@@ -457,11 +457,11 @@ char* Log_CreateRtfHeader(MODULEINFO *mi)
int iIndent = 0;
if (g_Settings->dwIconFlags) {
- iIndent += (14 * 1440) / ci.logPixelSX;
+ iIndent += (14 * 1440) / chatApi.logPixelSX;
Log_Append(buffer, bufferEnd, bufferAlloced, "\\tx%u", iIndent);
}
if (g_Settings->bShowTime) {
- int iSize = (g_Settings->LogTextIndent * 1440) / ci.logPixelSX;
+ int iSize = (g_Settings->LogTextIndent * 1440) / chatApi.logPixelSX;
Log_Append(buffer, bufferEnd, bufferAlloced, "\\tx%u", iIndent + iSize);
if (g_Settings->bLogIndentEnabled)
iIndent += iSize;
@@ -499,7 +499,7 @@ void LoadMsgLogBitmaps(void)
pLogIconBmpBits[i] = (char*)mir_alloc(size);
size_t rtfHeaderSize = mir_snprintf((char *)pLogIconBmpBits[i], size, "{\\pict\\dibitmap0\\wbmbitspixel%u\\wbmplanes1\\wbmwidthbytes%u\\picw%u\\pich%u ", bih.biBitCount, widthBytes, bih.biWidth, bih.biHeight);
- HICON hIcon = ci.hIcons[i];
+ HICON hIcon = chatApi.hIcons[i];
HBITMAP hoBmp = (HBITMAP)SelectObject(hdcMem, hBmp);
FillRect(hdcMem, &rc, hBkgBrush);
DrawIconEx(hdcMem, 0, 0, hIcon, bih.biWidth, bih.biHeight, 0, NULL, DI_NORMAL);
@@ -519,19 +519,18 @@ void LoadMsgLogBitmaps(void)
ReleaseDC(NULL, hdc);
DeleteObject(hBkgBrush);
- if (ci.logPixelSY == 0) {
- HDC hdc;
+ if (chatApi.logPixelSY == 0) {
hdc = GetDC(NULL);
- ci.logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
- ci.logPixelSX = GetDeviceCaps(hdc, LOGPIXELSX);
+ chatApi.logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
+ chatApi.logPixelSX = GetDeviceCaps(hdc, LOGPIXELSX);
ReleaseDC(NULL, hdc);
}
for (int i = 0; i < OPTIONS_FONTCOUNT; i++) {
- LOGFONT &F = ci.aFonts[i].lf;
+ LOGFONT &F = chatApi.aFonts[i].lf;
mir_snprintf(CHAT_rtfFontsGlobal[i], RTFCACHELINESIZE,
"\\f%u\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u", i, i + 1,
- F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / ci.logPixelSY);
+ F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / chatApi.logPixelSY);
}
}
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp
index df700a1030..361069cf08 100644
--- a/src/mir_app/src/chat_manager.cpp
+++ b/src/mir_app/src/chat_manager.cpp
@@ -26,32 +26,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define WINDOWS_COMMANDS_MAX 30
-CHAT_MANAGER ci;
+CHAT_MANAGER chatApi;
MODULEINFO *m_ModList = 0;
static void SetActiveSessionEx(SESSION_INFO *si)
{
if (si) {
- replaceStrT(ci.szActiveWndID, si->ptszID);
- replaceStr(ci.szActiveWndModule, si->pszModule);
+ replaceStrT(chatApi.szActiveWndID, si->ptszID);
+ replaceStr(chatApi.szActiveWndModule, si->pszModule);
}
}
static void SetActiveSession(const TCHAR *pszID, const char *pszModule)
{
- SESSION_INFO *si = ci.SM_FindSession(pszID, pszModule);
+ SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si)
SetActiveSessionEx(si);
}
static SESSION_INFO* GetActiveSession(void)
{
- SESSION_INFO *si = ci.SM_FindSession(ci.szActiveWndID, ci.szActiveWndModule);
+ SESSION_INFO *si = chatApi.SM_FindSession(chatApi.szActiveWndID, chatApi.szActiveWndModule);
if (si)
return si;
- return ci.wndList;
+ return chatApi.wndList;
}
//---------------------------------------------------
@@ -69,13 +69,13 @@ static SESSION_INFO* SM_AddSession(const TCHAR *pszID, const char *pszModule)
node->ptszID = mir_tstrdup(pszID);
node->pszModule = mir_strdup(pszModule);
- if (ci.wndList == NULL) { // list is empty
- ci.wndList = node;
+ if (chatApi.wndList == NULL) { // list is empty
+ chatApi.wndList = node;
node->next = NULL;
}
else {
- node->next = ci.wndList;
- ci.wndList = node;
+ node->next = chatApi.wndList;
+ chatApi.wndList = node;
}
return node;
}
@@ -85,15 +85,15 @@ static void SM_FreeSession(SESSION_INFO *si)
// contact may have been deleted here already, since function may be called after deleting
// contact so the handle may be invalid, therefore db_get_b shall return 0
if (si->hContact && db_get_b(si->hContact, si->pszModule, "ChatRoom", 0) != 0) {
- ci.SetOffline(si->hContact, (si->iType == GCW_CHATROOM || si->iType == GCW_PRIVMESS) ? TRUE : FALSE);
+ chatApi.SetOffline(si->hContact, (si->iType == GCW_CHATROOM || si->iType == GCW_PRIVMESS) ? TRUE : FALSE);
db_set_s(si->hContact, si->pszModule, "Topic", "");
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
db_unset(si->hContact, "CList", "StatusMsg");
}
- ci.UM_RemoveAll(&si->pUsers);
- ci.TM_RemoveAll(&si->pStatuses);
- ci.LM_RemoveAll(&si->pLog, &si->pLogEnd);
+ chatApi.UM_RemoveAll(&si->pUsers);
+ chatApi.TM_RemoveAll(&si->pStatuses);
+ chatApi.LM_RemoveAll(&si->pLog, &si->pLogEnd);
si->iStatusCount = 0;
si->nUsersInNicklist = 0;
@@ -119,18 +119,18 @@ static int SM_RemoveSession(const TCHAR *pszID, const char *pszModule, BOOL remo
if (!pszModule)
return FALSE;
- SESSION_INFO *pTemp = ci.wndList, *pLast = NULL;
+ SESSION_INFO *pTemp = chatApi.wndList, *pLast = NULL;
while (pTemp != NULL) {
// match
if ((!pszID && pTemp->iType != GCW_SERVER || !mir_tstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
DWORD dw = pTemp->dwItemData;
- if (ci.OnRemoveSession)
- ci.OnRemoveSession(pTemp);
+ if (chatApi.OnRemoveSession)
+ chatApi.OnRemoveSession(pTemp);
DoEventHook(pTemp->ptszID, pTemp->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (DWORD)pTemp->dwItemData);
if (pLast == NULL)
- ci.wndList = pTemp->next;
+ chatApi.wndList = pTemp->next;
else
pLast->next = pTemp->next;
@@ -146,7 +146,7 @@ static int SM_RemoveSession(const TCHAR *pszID, const char *pszModule, BOOL remo
if (pLast)
pTemp = pLast->next;
else
- pTemp = ci.wndList;
+ pTemp = chatApi.wndList;
}
else {
pLast = pTemp;
@@ -161,7 +161,7 @@ static SESSION_INFO* SM_FindSession(const TCHAR *pszID, const char *pszModule)
if (!pszID || !pszModule)
return NULL;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next)
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next)
if (!mir_tstrcmpi(si->ptszID, pszID) && !mir_strcmpi(si->pszModule, pszModule))
return si;
@@ -173,16 +173,16 @@ static BOOL SM_SetOffline(const TCHAR *pszID, const char *pszModule)
if (!pszModule)
return FALSE;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if ((pszID && mir_tstrcmpi(si->ptszID, pszID)) || mir_strcmpi(si->pszModule, pszModule))
continue;
- ci.UM_RemoveAll(&si->pUsers);
+ chatApi.UM_RemoveAll(&si->pUsers);
si->nUsersInNicklist = 0;
if (si->iType != GCW_SERVER)
si->bInitDone = FALSE;
- if (ci.OnOfflineSession)
- ci.OnOfflineSession(si);
+ if (chatApi.OnOfflineSession)
+ chatApi.OnOfflineSession(si);
if (pszID)
return TRUE;
}
@@ -194,11 +194,11 @@ static BOOL SM_SetStatusEx(const TCHAR *pszID, const char *pszModule, const TCHA
if (!pszModule)
return FALSE;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if ((pszID && mir_tstrcmpi(si->ptszID, pszID)) || mir_strcmpi(si->pszModule, pszModule))
continue;
- ci.UM_SetStatusEx(si->pUsers, pszText, flags);
+ chatApi.UM_SetStatusEx(si->pUsers, pszText, flags);
if (si->hWnd)
RedrawWindow(GetDlgItem(si->hWnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
if (pszID)
@@ -212,36 +212,36 @@ static HICON SM_GetStatusIcon(SESSION_INFO *si, USERINFO * ui)
if (!ui || !si)
return NULL;
- STATUSINFO *ti = ci.TM_FindStatus(si->pStatuses, ci.TM_WordToString(si->pStatuses, ui->Status));
+ STATUSINFO *ti = chatApi.TM_FindStatus(si->pStatuses, chatApi.TM_WordToString(si->pStatuses, ui->Status));
if (ti != NULL) {
if ((UINT_PTR)ti->hIcon >= STATUSICONCOUNT)
return ti->hIcon;
- return ci.hIcons[ICON_STATUS0 + (int)ti->hIcon];
+ return chatApi.hIcons[ICON_STATUS0 + (int)ti->hIcon];
}
- return ci.hIcons[ICON_STATUS0];
+ return chatApi.hIcons[ICON_STATUS0];
}
static BOOL SM_AddEventToAllMatchingUID(GCEVENT *gce)
{
int bManyFix = 0;
- for (SESSION_INFO *p = ci.wndList; p != NULL; p = p->next) {
+ for (SESSION_INFO *p = chatApi.wndList; p != NULL; p = p->next) {
if (!p->bInitDone || mir_strcmpi(p->pszModule, gce->pDest->pszModule))
continue;
- if (!ci.UM_FindUser(p->pUsers, gce->ptszUID))
+ if (!chatApi.UM_FindUser(p->pUsers, gce->ptszUID))
continue;
- if (ci.OnEventBroadcast)
- ci.OnEventBroadcast(p, gce);
+ if (chatApi.OnEventBroadcast)
+ chatApi.OnEventBroadcast(p, gce);
if (!(gce->dwFlags & GCEF_NOTNOTIFY))
- ci.DoSoundsFlashPopupTrayStuff(p, gce, FALSE, bManyFix);
+ chatApi.DoSoundsFlashPopupTrayStuff(p, gce, FALSE, bManyFix);
bManyFix++;
if ((gce->dwFlags & GCEF_ADDTOLOG) && g_Settings->bLoggingEnabled)
- ci.LogToFile(p, gce);
+ chatApi.LogToFile(p, gce);
}
return 0;
@@ -253,7 +253,7 @@ static BOOL SM_AddEvent(const TCHAR *pszID, const char *pszModule, GCEVENT *gce,
if (p == NULL)
return TRUE;
- LOGINFO *li = ci.LM_AddEvent(&p->pLog, &p->pLogEnd);
+ LOGINFO *li = chatApi.LM_AddEvent(&p->pLog, &p->pLogEnd);
p->iEventCount += 1;
li->iType = gce->pDest->iType;
@@ -267,7 +267,7 @@ static BOOL SM_AddEvent(const TCHAR *pszID, const char *pszModule, GCEVENT *gce,
li->bIsHighlighted = bIsHighlighted;
if (g_Settings->iEventLimit > 0 && p->iEventCount > g_Settings->iEventLimit + 20) {
- ci.LM_TrimLog(&p->pLog, &p->pLogEnd, p->iEventCount - g_Settings->iEventLimit);
+ chatApi.LM_TrimLog(&p->pLog, &p->pLogEnd, p->iEventCount - g_Settings->iEventLimit);
p->bTrimmed = true;
p->iEventCount = g_Settings->iEventLimit;
return FALSE;
@@ -281,10 +281,10 @@ static USERINFO* SM_AddUser(const TCHAR *pszID, const char *pszModule, const TCH
if (si == NULL)
return NULL;
- USERINFO *p = ci.UM_AddUser(si->pStatuses, &si->pUsers, pszUID, pszNick, wStatus);
+ USERINFO *p = chatApi.UM_AddUser(si->pStatuses, &si->pUsers, pszUID, pszNick, wStatus);
si->nUsersInNicklist++;
- if (ci.OnAddUser)
- ci.OnAddUser(si, p);
+ if (chatApi.OnAddUser)
+ chatApi.OnAddUser(si, p);
return p;
}
@@ -297,7 +297,7 @@ static BOOL SM_MoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR *
if (si == NULL)
return FALSE;
- ci.UM_SortUser(&si->pUsers, pszUID);
+ chatApi.UM_SortUser(&si->pUsers, pszUID);
return TRUE;
}
@@ -306,17 +306,17 @@ static BOOL SM_RemoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR
if (!pszModule || !pszUID)
return FALSE;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if ((pszID && mir_tstrcmpi(si->ptszID, pszID)) || mir_strcmpi(si->pszModule, pszModule))
continue;
- USERINFO *ui = ci.UM_FindUser(si->pUsers, pszUID);
+ USERINFO *ui = chatApi.UM_FindUser(si->pUsers, pszUID);
if (ui) {
si->nUsersInNicklist--;
- if (ci.OnRemoveUser)
- ci.OnRemoveUser(si, ui);
+ if (chatApi.OnRemoveUser)
+ chatApi.OnRemoveUser(si, ui);
- ci.UM_RemoveUser(&si->pUsers, pszUID);
+ chatApi.UM_RemoveUser(&si->pUsers, pszUID);
if (si->hWnd)
SendMessage(si->hWnd, GC_UPDATENICKLIST, 0, 0);
@@ -332,7 +332,7 @@ static BOOL SM_RemoveUser(const TCHAR *pszID, const char *pszModule, const TCHAR
static USERINFO* SM_GetUserFromIndex(const TCHAR *pszID, const char *pszModule, int index)
{
SESSION_INFO *si = SM_FindSession(pszID, pszModule);
- return (si == NULL) ? NULL : ci.UM_FindUserFromIndex(si->pUsers, index);
+ return (si == NULL) ? NULL : chatApi.UM_FindUserFromIndex(si->pUsers, index);
}
STATUSINFO* SM_AddStatus(const TCHAR *pszID, const char *pszModule, const TCHAR *pszStatus)
@@ -341,11 +341,11 @@ STATUSINFO* SM_AddStatus(const TCHAR *pszID, const char *pszModule, const TCHAR
if (si == NULL)
return NULL;
- STATUSINFO *ti = ci.TM_AddStatus(&si->pStatuses, pszStatus, &si->iStatusCount);
+ STATUSINFO *ti = chatApi.TM_AddStatus(&si->pStatuses, pszStatus, &si->iStatusCount);
if (ti)
si->iStatusCount++;
- if (ci.OnAddStatus)
- ci.OnAddStatus(si, ti);
+ if (chatApi.OnAddStatus)
+ chatApi.OnAddStatus(si, ti);
return ti;
}
@@ -355,7 +355,7 @@ static BOOL SM_GiveStatus(const TCHAR *pszID, const char *pszModule, const TCHAR
if (si == NULL)
return FALSE;
- USERINFO *ui = ci.UM_GiveStatus(si->pUsers, pszUID, ci.TM_StringToWord(si->pStatuses, pszStatus));
+ USERINFO *ui = chatApi.UM_GiveStatus(si->pUsers, pszUID, chatApi.TM_StringToWord(si->pStatuses, pszStatus));
if (ui) {
SM_MoveUser(si->ptszID, si->pszModule, ui->pszUID);
if (si->hWnd)
@@ -370,7 +370,7 @@ static BOOL SM_SetContactStatus(const TCHAR *pszID, const char *pszModule, const
if (si == NULL)
return FALSE;
- USERINFO *ui = ci.UM_SetContactStatus(si->pUsers, pszUID, wStatus);
+ USERINFO *ui = chatApi.UM_SetContactStatus(si->pUsers, pszUID, wStatus);
if (ui) {
SM_MoveUser(si->ptszID, si->pszModule, ui->pszUID);
if (si->hWnd)
@@ -385,7 +385,7 @@ static BOOL SM_TakeStatus(const TCHAR *pszID, const char *pszModule, const TCHAR
if (si == NULL)
return FALSE;
- USERINFO *ui = ci.UM_TakeStatus(si->pUsers, pszUID, ci.TM_StringToWord(si->pStatuses, pszStatus));
+ USERINFO *ui = chatApi.UM_TakeStatus(si->pUsers, pszUID, chatApi.TM_StringToWord(si->pStatuses, pszStatus));
if (ui) {
SM_MoveUser(si->ptszID, si->pszModule, ui->pszUID);
if (si->hWnd)
@@ -399,7 +399,7 @@ static LRESULT SM_SendMessage(const TCHAR *pszID, const char *pszModule, UINT ms
if (pszModule == NULL)
return 0;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if ((pszID && mir_tstrcmpi(si->ptszID, pszID)) || mir_strcmpi(si->pszModule, pszModule))
continue;
@@ -427,7 +427,7 @@ static BOOL SM_PostMessage(const TCHAR *pszID, const char *pszModule, UINT msg,
static BOOL SM_BroadcastMessage(const char *pszModule, UINT msg, WPARAM wParam, LPARAM lParam, BOOL bAsync)
{
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if (pszModule && _strcmpi(si->pszModule, pszModule))
continue;
@@ -446,7 +446,7 @@ static BOOL SM_SetStatus(const TCHAR *pszID, const char *pszModule, int wStatus)
if (!pszModule)
return FALSE;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if ((pszID && mir_tstrcmpi(si->ptszID, pszID)) || mir_strcmpi(si->pszModule, pszModule))
continue;
@@ -458,8 +458,8 @@ static BOOL SM_SetStatus(const TCHAR *pszID, const char *pszModule, int wStatus)
db_set_w(si->hContact, si->pszModule, "Status", (WORD)wStatus);
}
- if (ci.OnSetStatus)
- ci.OnSetStatus(si, wStatus);
+ if (chatApi.OnSetStatus)
+ chatApi.OnSetStatus(si, wStatus);
if (pszID)
return TRUE;
@@ -472,7 +472,7 @@ static BOOL SM_SendUserMessage(const TCHAR *pszID, const char *pszModule, const
if (!pszModule || !pszText)
return FALSE;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if ((pszID && mir_tstrcmpi(si->ptszID, pszID)) || mir_strcmpi(si->pszModule, pszModule))
continue;
@@ -489,11 +489,11 @@ static BOOL SM_ChangeUID(const TCHAR *pszID, const char *pszModule, const TCHAR
if (!pszModule)
return FALSE;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if ((pszID && mir_tstrcmpi(si->ptszID, pszID)) || mir_strcmpi(si->pszModule, pszModule))
continue;
- USERINFO* ui = ci.UM_FindUser(si->pUsers, pszUID);
+ USERINFO* ui = chatApi.UM_FindUser(si->pUsers, pszUID);
if (ui)
replaceStrT(ui->pszUID, pszNewUID);
if (pszID)
@@ -507,16 +507,16 @@ static BOOL SM_ChangeNick(const TCHAR *pszID, const char *pszModule, GCEVENT *gc
if (!pszModule)
return FALSE;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if ((!pszID || !mir_tstrcmpi(si->ptszID, pszID)) && !mir_strcmpi(si->pszModule, pszModule)) {
- USERINFO *ui = ci.UM_FindUser(si->pUsers, gce->ptszUID);
+ USERINFO *ui = chatApi.UM_FindUser(si->pUsers, gce->ptszUID);
if (ui) {
replaceStrT(ui->pszNick, gce->ptszText);
SM_MoveUser(si->ptszID, si->pszModule, ui->pszUID);
if (si->hWnd)
SendMessage(si->hWnd, GC_UPDATENICKLIST, 0, 0);
- if (ci.OnChangeNick)
- ci.OnChangeNick(si);
+ if (chatApi.OnChangeNick)
+ chatApi.OnChangeNick(si);
}
if (pszID)
@@ -528,7 +528,7 @@ static BOOL SM_ChangeNick(const TCHAR *pszID, const char *pszModule, GCEVENT *gc
static BOOL SM_SetTabbedWindowHwnd(SESSION_INFO *si, HWND hwnd)
{
- for (SESSION_INFO *p = ci.wndList; p != NULL; p = p->next) {
+ for (SESSION_INFO *p = chatApi.wndList; p != NULL; p = p->next) {
if (si && si == p)
p->hWnd = hwnd;
else
@@ -539,17 +539,17 @@ static BOOL SM_SetTabbedWindowHwnd(SESSION_INFO *si, HWND hwnd)
static BOOL SM_RemoveAll(void)
{
- while (ci.wndList) {
- SESSION_INFO *pLast = ci.wndList->next;
+ while (chatApi.wndList) {
+ SESSION_INFO *pLast = chatApi.wndList->next;
- if (ci.wndList->hWnd)
- SendMessage(ci.wndList->hWnd, GC_EVENT_CONTROL + WM_USER + 500, SESSION_TERMINATE, 0);
- DoEventHook(ci.wndList->ptszID, ci.wndList->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (DWORD)ci.wndList->dwItemData);
+ if (chatApi.wndList->hWnd)
+ SendMessage(chatApi.wndList->hWnd, GC_EVENT_CONTROL + WM_USER + 500, SESSION_TERMINATE, 0);
+ DoEventHook(chatApi.wndList->ptszID, chatApi.wndList->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (DWORD)chatApi.wndList->dwItemData);
- SM_FreeSession(ci.wndList);
- ci.wndList = pLast;
+ SM_FreeSession(chatApi.wndList);
+ chatApi.wndList = pLast;
}
- ci.wndList = NULL;
+ chatApi.wndList = NULL;
return TRUE;
}
@@ -625,7 +625,7 @@ static int SM_GetCount(const char *pszModule)
{
int count = 0;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next)
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next)
if (!mir_strcmpi(pszModule, si->pszModule))
count++;
@@ -635,7 +635,7 @@ static int SM_GetCount(const char *pszModule)
static SESSION_INFO* SM_FindSessionByIndex(const char *pszModule, int iItem)
{
int count = 0;
- for (SESSION_INFO *si = ci.wndList; si != NULL; si = si->next) {
+ for (SESSION_INFO *si = chatApi.wndList; si != NULL; si = si->next) {
if (!mir_strcmpi(pszModule, si->pszModule)) {
if (iItem == count)
return si;
@@ -653,7 +653,7 @@ static char* SM_GetUsers(SESSION_INFO *si)
return NULL;
USERINFO *utemp = NULL;
- for (SESSION_INFO *p = ci.wndList; p != NULL; p = p->next) {
+ for (SESSION_INFO *p = chatApi.wndList; p != NULL; p = p->next) {
if (si == p) {
if ((utemp = p->pUsers) == NULL)
return NULL;
@@ -681,7 +681,7 @@ static char* SM_GetUsers(SESSION_INFO *si)
static void SM_InvalidateLogDirectories()
{
- for (SESSION_INFO *si = ci.wndList; si; si = si->next)
+ for (SESSION_INFO *si = chatApi.wndList; si; si = si->next)
si->pszLogFileName[0] = si->pszLogFileName[1] = 0;
}
@@ -697,13 +697,13 @@ static MODULEINFO* MM_AddModule(const char *pszModule)
if (pszModule == NULL)
return NULL;
- if (ci.MM_FindModule(pszModule))
+ if (chatApi.MM_FindModule(pszModule))
return NULL;
MODULEINFO *node = (MODULEINFO*)mir_calloc(g_cbModuleInfo);
replaceStr(node->pszModule, pszModule);
- if (ci.OnCreateModule)
- ci.OnCreateModule(node);
+ if (chatApi.OnCreateModule)
+ chatApi.OnCreateModule(node);
if (m_ModList == NULL) { // list is empty
m_ModList = node;
@@ -726,15 +726,15 @@ static void MM_IconsChanged()
Safe_DestroyIcon(mi->hOnlineTalkIcon);
Safe_DestroyIcon(mi->hOfflineTalkIcon);
- if (ci.OnCreateModule) // recreate icons
- ci.OnCreateModule(mi);
+ if (chatApi.OnCreateModule) // recreate icons
+ chatApi.OnCreateModule(mi);
}
}
static void MM_FontsChanged()
{
for (MODULEINFO *mi = m_ModList; mi != NULL; mi = mi->next)
- mi->pszHeader = ci.Log_CreateRtfHeader(mi);
+ mi->pszHeader = chatApi.Log_CreateRtfHeader(mi);
}
static MODULEINFO* MM_FindModule(const char *pszModule)
@@ -789,7 +789,7 @@ static STATUSINFO* TM_AddStatus(STATUSINFO **ppStatusList, const TCHAR *pszStatu
if (!ppStatusList || !pszStatus)
return NULL;
- if (!ci.TM_FindStatus(*ppStatusList, pszStatus)) {
+ if (!chatApi.TM_FindStatus(*ppStatusList, pszStatus)) {
STATUSINFO *node = (STATUSINFO*)mir_alloc(sizeof(STATUSINFO));
memset(node, 0, sizeof(STATUSINFO));
replaceStrT(node->pszGroup, pszStatus);
@@ -921,7 +921,7 @@ static USERINFO* UM_SortUser(USERINFO **ppUserList, const TCHAR *pszUID)
pLast = NULL;
- while (ui && ci.UM_CompareItem(ui, node->pszNick, node->Status) <= 0) {
+ while (ui && chatApi.UM_CompareItem(ui, node->pszNick, node->Status) <= 0) {
pLast = ui;
ui = ui->next;
}
@@ -950,7 +950,7 @@ USERINFO* UM_AddUser(STATUSINFO *pStatusList, USERINFO **ppUserList, const TCHAR
return NULL;
USERINFO *ui = *ppUserList, *pLast = NULL;
- while (ui && ci.UM_CompareItem(ui, pszNick, wStatus) <= 0) {
+ while (ui && chatApi.UM_CompareItem(ui, pszNick, wStatus) <= 0) {
pLast = ui;
ui = ui->next;
}
@@ -1179,21 +1179,21 @@ static BOOL LM_RemoveAll(LOGINFO **ppLogListStart, LOGINFO **ppLogListEnd)
INT_PTR SvcGetChatManager(WPARAM wParam, LPARAM lParam)
{
if (lParam == NULL)
- return (INT_PTR)&ci;
+ return (INT_PTR)&chatApi;
// wipe out old junk
- memset(PBYTE(&ci) + offsetof(CHAT_MANAGER, OnCreateModule), 0, sizeof(CHAT_MANAGER)-offsetof(CHAT_MANAGER, OnCreateModule));
+ memset(PBYTE(&chatApi) + offsetof(CHAT_MANAGER, OnCreateModule), 0, sizeof(CHAT_MANAGER) - offsetof(CHAT_MANAGER, OnCreateModule));
CHAT_MANAGER_INITDATA *pInit = (CHAT_MANAGER_INITDATA*)lParam;
if (g_cbSession) { // reallocate old sessions
mir_cslock lck(cs);
SESSION_INFO *pPrev = NULL;
- for (SESSION_INFO *p = ci.wndList; p; p = p->next) {
+ for (SESSION_INFO *p = chatApi.wndList; p; p = p->next) {
SESSION_INFO *p1 = (SESSION_INFO*)mir_realloc(p, pInit->cbSession);
memset(PBYTE(p1) + sizeof(GCSessionInfoBase), 0, pInit->cbSession - sizeof(GCSessionInfoBase));
if (p1 != p) { // realloc could change a pointer, reinsert a structure
- if (ci.wndList == p)
- ci.wndList = p1;
+ if (chatApi.wndList == p)
+ chatApi.wndList = p1;
if (pPrev != NULL)
pPrev->next = p1;
p = p1;
@@ -1224,105 +1224,105 @@ INT_PTR SvcGetChatManager(WPARAM wParam, LPARAM lParam)
g_iFontMode = pInit->iFontMode;
g_iChatLang = (int)wParam;
- ci.SetActiveSession = SetActiveSession;
- ci.SetActiveSessionEx = SetActiveSessionEx;
- ci.GetActiveSession = GetActiveSession;
- ci.SM_AddSession = SM_AddSession;
- ci.SM_RemoveSession = SM_RemoveSession;
- ci.SM_FindSession = SM_FindSession;
- ci.SM_AddUser = SM_AddUser;
- ci.SM_ChangeUID = SM_ChangeUID;
- ci.SM_ChangeNick = SM_ChangeNick;
- ci.SM_RemoveUser = SM_RemoveUser;
- ci.SM_SetOffline = SM_SetOffline;
- ci.SM_SetTabbedWindowHwnd = SM_SetTabbedWindowHwnd;
- ci.SM_GetStatusIcon = SM_GetStatusIcon;
- ci.SM_SetStatus = SM_SetStatus;
- ci.SM_SetStatusEx = SM_SetStatusEx;
- ci.SM_SendUserMessage = SM_SendUserMessage;
- ci.SM_AddStatus = SM_AddStatus;
- ci.SM_AddEventToAllMatchingUID = SM_AddEventToAllMatchingUID;
- ci.SM_AddEvent = SM_AddEvent;
- ci.SM_SendMessage = SM_SendMessage;
- ci.SM_PostMessage = SM_PostMessage;
- ci.SM_BroadcastMessage = SM_BroadcastMessage;
- ci.SM_RemoveAll = SM_RemoveAll;
- ci.SM_GiveStatus = SM_GiveStatus;
- ci.SM_SetContactStatus = SM_SetContactStatus;
- ci.SM_TakeStatus = SM_TakeStatus;
- ci.SM_MoveUser = SM_MoveUser;
- ci.SM_AddCommand = SM_AddCommand;
- ci.SM_GetPrevCommand = SM_GetPrevCommand;
- ci.SM_GetNextCommand = SM_GetNextCommand;
- ci.SM_GetCount = SM_GetCount;
- ci.SM_FindSessionByIndex = SM_FindSessionByIndex;
- ci.SM_GetUsers = SM_GetUsers;
- ci.SM_GetUserFromIndex = SM_GetUserFromIndex;
- ci.SM_InvalidateLogDirectories = SM_InvalidateLogDirectories;
-
- ci.MM_AddModule = MM_AddModule;
- ci.MM_FindModule = MM_FindModule;
- ci.MM_FixColors = MM_FixColors;
- ci.MM_FontsChanged = MM_FontsChanged;
- ci.MM_IconsChanged = MM_IconsChanged;
- ci.MM_RemoveAll = MM_RemoveAll;
-
- ci.TM_AddStatus = TM_AddStatus;
- ci.TM_FindStatus = TM_FindStatus;
- ci.TM_StringToWord = TM_StringToWord;
- ci.TM_WordToString = TM_WordToString;
- ci.TM_RemoveAll = TM_RemoveAll;
-
- ci.UM_SetStatusEx = UM_SetStatusEx;
- ci.UM_AddUser = UM_AddUser;
- ci.UM_SortUser = UM_SortUser;
- ci.UM_FindUser = UM_FindUser;
- ci.UM_FindUserFromIndex = UM_FindUserFromIndex;
- ci.UM_GiveStatus = UM_GiveStatus;
- ci.UM_SetContactStatus = UM_SetContactStatus;
- ci.UM_TakeStatus = UM_TakeStatus;
- ci.UM_FindUserAutoComplete = UM_FindUserAutoComplete;
- ci.UM_RemoveUser = UM_RemoveUser;
- ci.UM_RemoveAll = UM_RemoveAll;
- ci.UM_CompareItem = UM_CompareItem;
-
- ci.LM_AddEvent = LM_AddEvent;
- ci.LM_TrimLog = LM_TrimLog;
- ci.LM_RemoveAll = LM_RemoveAll;
-
- ci.AddRoom = AddRoom;
- ci.SetOffline = SetOffline;
- ci.SetAllOffline = SetAllOffline;
- ci.AddEvent = AddEvent;
- ci.FindRoom = FindRoom;
- ci.DoRtfToTags = DoRtfToTags;
-
- ci.Log_CreateRTF = Log_CreateRTF;
- ci.Log_CreateRtfHeader = Log_CreateRtfHeader;
- ci.LoadMsgDlgFont = LoadMsgDlgFont;
- ci.MakeTimeStamp = MakeTimeStamp;
-
- ci.DoEventHook = DoEventHook;
- ci.DoEventHookAsync = DoEventHookAsync;
-
- ci.DoSoundsFlashPopupTrayStuff = DoSoundsFlashPopupTrayStuff;
- ci.DoTrayIcon = DoTrayIcon;
- ci.DoPopup = DoPopup;
- ci.ShowPopup = ShowPopup;
- ci.LogToFile = LogToFile;
- ci.GetChatLogsFilename = GetChatLogsFilename;
- ci.GetColorIndex = GetColorIndex;
- ci.Log_SetStyle = Log_SetStyle;
-
- ci.IsHighlighted = IsHighlighted;
- ci.RemoveFormatting = RemoveFormatting;
- ci.ReloadSettings = LoadGlobalSettings;
- ci.ColorChooser = ColorChooser;
-
- ci.pLogIconBmpBits = pLogIconBmpBits;
- ci.logIconBmpSize = logIconBmpSize;
+ chatApi.SetActiveSession = SetActiveSession;
+ chatApi.SetActiveSessionEx = SetActiveSessionEx;
+ chatApi.GetActiveSession = GetActiveSession;
+ chatApi.SM_AddSession = SM_AddSession;
+ chatApi.SM_RemoveSession = SM_RemoveSession;
+ chatApi.SM_FindSession = SM_FindSession;
+ chatApi.SM_AddUser = SM_AddUser;
+ chatApi.SM_ChangeUID = SM_ChangeUID;
+ chatApi.SM_ChangeNick = SM_ChangeNick;
+ chatApi.SM_RemoveUser = SM_RemoveUser;
+ chatApi.SM_SetOffline = SM_SetOffline;
+ chatApi.SM_SetTabbedWindowHwnd = SM_SetTabbedWindowHwnd;
+ chatApi.SM_GetStatusIcon = SM_GetStatusIcon;
+ chatApi.SM_SetStatus = SM_SetStatus;
+ chatApi.SM_SetStatusEx = SM_SetStatusEx;
+ chatApi.SM_SendUserMessage = SM_SendUserMessage;
+ chatApi.SM_AddStatus = SM_AddStatus;
+ chatApi.SM_AddEventToAllMatchingUID = SM_AddEventToAllMatchingUID;
+ chatApi.SM_AddEvent = SM_AddEvent;
+ chatApi.SM_SendMessage = SM_SendMessage;
+ chatApi.SM_PostMessage = SM_PostMessage;
+ chatApi.SM_BroadcastMessage = SM_BroadcastMessage;
+ chatApi.SM_RemoveAll = SM_RemoveAll;
+ chatApi.SM_GiveStatus = SM_GiveStatus;
+ chatApi.SM_SetContactStatus = SM_SetContactStatus;
+ chatApi.SM_TakeStatus = SM_TakeStatus;
+ chatApi.SM_MoveUser = SM_MoveUser;
+ chatApi.SM_AddCommand = SM_AddCommand;
+ chatApi.SM_GetPrevCommand = SM_GetPrevCommand;
+ chatApi.SM_GetNextCommand = SM_GetNextCommand;
+ chatApi.SM_GetCount = SM_GetCount;
+ chatApi.SM_FindSessionByIndex = SM_FindSessionByIndex;
+ chatApi.SM_GetUsers = SM_GetUsers;
+ chatApi.SM_GetUserFromIndex = SM_GetUserFromIndex;
+ chatApi.SM_InvalidateLogDirectories = SM_InvalidateLogDirectories;
+
+ chatApi.MM_AddModule = MM_AddModule;
+ chatApi.MM_FindModule = MM_FindModule;
+ chatApi.MM_FixColors = MM_FixColors;
+ chatApi.MM_FontsChanged = MM_FontsChanged;
+ chatApi.MM_IconsChanged = MM_IconsChanged;
+ chatApi.MM_RemoveAll = MM_RemoveAll;
+
+ chatApi.TM_AddStatus = TM_AddStatus;
+ chatApi.TM_FindStatus = TM_FindStatus;
+ chatApi.TM_StringToWord = TM_StringToWord;
+ chatApi.TM_WordToString = TM_WordToString;
+ chatApi.TM_RemoveAll = TM_RemoveAll;
+
+ chatApi.UM_SetStatusEx = UM_SetStatusEx;
+ chatApi.UM_AddUser = UM_AddUser;
+ chatApi.UM_SortUser = UM_SortUser;
+ chatApi.UM_FindUser = UM_FindUser;
+ chatApi.UM_FindUserFromIndex = UM_FindUserFromIndex;
+ chatApi.UM_GiveStatus = UM_GiveStatus;
+ chatApi.UM_SetContactStatus = UM_SetContactStatus;
+ chatApi.UM_TakeStatus = UM_TakeStatus;
+ chatApi.UM_FindUserAutoComplete = UM_FindUserAutoComplete;
+ chatApi.UM_RemoveUser = UM_RemoveUser;
+ chatApi.UM_RemoveAll = UM_RemoveAll;
+ chatApi.UM_CompareItem = UM_CompareItem;
+
+ chatApi.LM_AddEvent = LM_AddEvent;
+ chatApi.LM_TrimLog = LM_TrimLog;
+ chatApi.LM_RemoveAll = LM_RemoveAll;
+
+ chatApi.AddRoom = AddRoom;
+ chatApi.SetOffline = SetOffline;
+ chatApi.SetAllOffline = SetAllOffline;
+ chatApi.AddEvent = AddEvent;
+ chatApi.FindRoom = FindRoom;
+ chatApi.DoRtfToTags = DoRtfToTags;
+
+ chatApi.Log_CreateRTF = Log_CreateRTF;
+ chatApi.Log_CreateRtfHeader = Log_CreateRtfHeader;
+ chatApi.LoadMsgDlgFont = LoadMsgDlgFont;
+ chatApi.MakeTimeStamp = MakeTimeStamp;
+
+ chatApi.DoEventHook = DoEventHook;
+ chatApi.DoEventHookAsync = DoEventHookAsync;
+
+ chatApi.DoSoundsFlashPopupTrayStuff = DoSoundsFlashPopupTrayStuff;
+ chatApi.DoTrayIcon = DoTrayIcon;
+ chatApi.DoPopup = DoPopup;
+ chatApi.ShowPopup = ShowPopup;
+ chatApi.LogToFile = LogToFile;
+ chatApi.GetChatLogsFilename = GetChatLogsFilename;
+ chatApi.GetColorIndex = GetColorIndex;
+ chatApi.Log_SetStyle = Log_SetStyle;
+
+ chatApi.IsHighlighted = IsHighlighted;
+ chatApi.RemoveFormatting = RemoveFormatting;
+ chatApi.ReloadSettings = LoadGlobalSettings;
+ chatApi.ColorChooser = ColorChooser;
+
+ chatApi.pLogIconBmpBits = pLogIconBmpBits;
+ chatApi.logIconBmpSize = logIconBmpSize;
RegisterFonts();
OptionsInit();
- return (INT_PTR)&ci;
+ return (INT_PTR)&chatApi;
}
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp
index ffb6e0d74e..a2d6810b51 100644
--- a/src/mir_app/src/chat_opts.cpp
+++ b/src/mir_app/src/chat_opts.cpp
@@ -78,16 +78,16 @@ static void LoadColors()
void LoadLogFonts(void)
{
for (int i=0; i < OPTIONS_FONTCOUNT; i++)
- LoadMsgDlgFont(i, &ci.aFonts[i].lf, &ci.aFonts[i].color);
+ LoadMsgDlgFont(i, &chatApi.aFonts[i].lf, &chatApi.aFonts[i].color);
LoadColors();
- if (ci.hListBkgBrush != NULL)
- DeleteObject(ci.hListBkgBrush);
- ci.hListBkgBrush = CreateSolidBrush(g_Settings->crUserListBGColor);
+ if (chatApi.hListBkgBrush != NULL)
+ DeleteObject(chatApi.hListBkgBrush);
+ chatApi.hListBkgBrush = CreateSolidBrush(g_Settings->crUserListBGColor);
- if (ci.hListSelectedBkgBrush != NULL)
- DeleteObject(ci.hListSelectedBkgBrush);
- ci.hListSelectedBkgBrush = CreateSolidBrush(g_Settings->crUserListSelectedBGColor);
+ if (chatApi.hListSelectedBkgBrush != NULL)
+ DeleteObject(chatApi.hListSelectedBkgBrush);
+ chatApi.hListSelectedBkgBrush = CreateSolidBrush(g_Settings->crUserListSelectedBGColor);
}
void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
@@ -234,8 +234,8 @@ void LoadGlobalSettings(void)
LoadColors();
- if (ci.OnLoadSettings)
- ci.OnLoadSettings();
+ if (chatApi.OnLoadSettings)
+ chatApi.OnLoadSettings();
InitSetting(&g_Settings->pszTimeStamp, "HeaderTime", _T("[%H:%M]"));
InitSetting(&g_Settings->pszTimeStampLog, "LogTimestamp", _T("[%d %b %y %H:%M]"));
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index 044457ef4c..6eceedb9ed 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -47,26 +47,26 @@ static HANDLE
void LoadChatIcons(void)
{
- ci.hIcons[ICON_ACTION] = LoadIconEx("log_action", FALSE);
- ci.hIcons[ICON_ADDSTATUS] = LoadIconEx("log_addstatus", FALSE);
- ci.hIcons[ICON_HIGHLIGHT] = LoadIconEx("log_highlight", FALSE);
- ci.hIcons[ICON_INFO] = LoadIconEx("log_info", FALSE);
- ci.hIcons[ICON_JOIN] = LoadIconEx("log_join", FALSE);
- ci.hIcons[ICON_KICK] = LoadIconEx("log_kick", FALSE);
- ci.hIcons[ICON_MESSAGE] = LoadIconEx("log_message_in", FALSE);
- ci.hIcons[ICON_MESSAGEOUT] = LoadIconEx("log_message_out", FALSE);
- ci.hIcons[ICON_NICK] = LoadIconEx("log_nick", FALSE);
- ci.hIcons[ICON_NOTICE] = LoadIconEx("log_notice", FALSE);
- ci.hIcons[ICON_PART] = LoadIconEx("log_part", FALSE);
- ci.hIcons[ICON_QUIT] = LoadIconEx("log_quit", FALSE);
- ci.hIcons[ICON_REMSTATUS] = LoadIconEx("log_removestatus", FALSE);
- ci.hIcons[ICON_TOPIC] = LoadIconEx("log_topic", FALSE);
- ci.hIcons[ICON_STATUS0] = LoadIconEx("status0", FALSE);
- ci.hIcons[ICON_STATUS1] = LoadIconEx("status1", FALSE);
- ci.hIcons[ICON_STATUS2] = LoadIconEx("status2", FALSE);
- ci.hIcons[ICON_STATUS3] = LoadIconEx("status3", FALSE);
- ci.hIcons[ICON_STATUS4] = LoadIconEx("status4", FALSE);
- ci.hIcons[ICON_STATUS5] = LoadIconEx("status5", FALSE);
+ chatApi.hIcons[ICON_ACTION] = LoadIconEx("log_action", FALSE);
+ chatApi.hIcons[ICON_ADDSTATUS] = LoadIconEx("log_addstatus", FALSE);
+ chatApi.hIcons[ICON_HIGHLIGHT] = LoadIconEx("log_highlight", FALSE);
+ chatApi.hIcons[ICON_INFO] = LoadIconEx("log_info", FALSE);
+ chatApi.hIcons[ICON_JOIN] = LoadIconEx("log_join", FALSE);
+ chatApi.hIcons[ICON_KICK] = LoadIconEx("log_kick", FALSE);
+ chatApi.hIcons[ICON_MESSAGE] = LoadIconEx("log_message_in", FALSE);
+ chatApi.hIcons[ICON_MESSAGEOUT] = LoadIconEx("log_message_out", FALSE);
+ chatApi.hIcons[ICON_NICK] = LoadIconEx("log_nick", FALSE);
+ chatApi.hIcons[ICON_NOTICE] = LoadIconEx("log_notice", FALSE);
+ chatApi.hIcons[ICON_PART] = LoadIconEx("log_part", FALSE);
+ chatApi.hIcons[ICON_QUIT] = LoadIconEx("log_quit", FALSE);
+ chatApi.hIcons[ICON_REMSTATUS] = LoadIconEx("log_removestatus", FALSE);
+ chatApi.hIcons[ICON_TOPIC] = LoadIconEx("log_topic", FALSE);
+ chatApi.hIcons[ICON_STATUS0] = LoadIconEx("status0", FALSE);
+ chatApi.hIcons[ICON_STATUS1] = LoadIconEx("status1", FALSE);
+ chatApi.hIcons[ICON_STATUS2] = LoadIconEx("status2", FALSE);
+ chatApi.hIcons[ICON_STATUS3] = LoadIconEx("status3", FALSE);
+ chatApi.hIcons[ICON_STATUS4] = LoadIconEx("status4", FALSE);
+ chatApi.hIcons[ICON_STATUS5] = LoadIconEx("status5", FALSE);
FreeMsgLogBitmaps();
LoadMsgLogBitmaps();
@@ -83,9 +83,9 @@ static int FontsChanged(WPARAM, LPARAM)
SetIndentSize();
g_Settings->bLogIndentEnabled = (db_get_b(NULL, CHAT_MODULE, "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
- ci.MM_FontsChanged();
- ci.MM_FixColors();
- ci.SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
+ chatApi.MM_FontsChanged();
+ chatApi.MM_FixColors();
+ chatApi.SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
return 0;
}
@@ -94,28 +94,28 @@ static int IconsChanged(WPARAM, LPARAM)
FreeMsgLogBitmaps();
LoadMsgLogBitmaps();
- ci.MM_IconsChanged();
- ci.SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, FALSE);
+ chatApi.MM_IconsChanged();
+ chatApi.SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, FALSE);
return 0;
}
static int PreShutdown(WPARAM, LPARAM)
{
if (g_Settings != NULL) {
- ci.SM_BroadcastMessage(NULL, GC_CLOSEWINDOW, 0, 1, FALSE);
+ chatApi.SM_BroadcastMessage(NULL, GC_CLOSEWINDOW, 0, 1, FALSE);
- ci.SM_RemoveAll();
- ci.MM_RemoveAll();
+ chatApi.SM_RemoveAll();
+ chatApi.MM_RemoveAll();
- DeleteObject(ci.hListBkgBrush);
- DeleteObject(ci.hListSelectedBkgBrush);
+ DeleteObject(chatApi.hListBkgBrush);
+ DeleteObject(chatApi.hListSelectedBkgBrush);
}
return 0;
}
static int SmileyOptionsChanged(WPARAM, LPARAM)
{
- ci.SM_BroadcastMessage(NULL, GC_REDRAWLOG, 0, 1, FALSE);
+ chatApi.SM_BroadcastMessage(NULL, GC_REDRAWLOG, 0, 1, FALSE);
return 0;
}
@@ -125,7 +125,7 @@ static INT_PTR Service_GetCount(WPARAM, LPARAM lParam)
return -1;
mir_cslock lck(cs);
- return ci.SM_GetCount((char *)lParam);
+ return chatApi.SM_GetCount((char *)lParam);
}
static INT_PTR Service_GetInfo(WPARAM, LPARAM lParam)
@@ -138,9 +138,9 @@ static INT_PTR Service_GetInfo(WPARAM, LPARAM lParam)
SESSION_INFO *si;
if (gci->Flags & GCF_BYINDEX)
- si = ci.SM_FindSessionByIndex(gci->pszModule, gci->iItem);
+ si = chatApi.SM_FindSessionByIndex(gci->pszModule, gci->iItem);
else
- si = ci.SM_FindSession(gci->pszID, gci->pszModule);
+ si = chatApi.SM_FindSession(gci->pszID, gci->pszModule);
if (si == NULL)
return 1;
@@ -148,7 +148,7 @@ static INT_PTR Service_GetInfo(WPARAM, LPARAM lParam)
if (gci->Flags & GCF_HCONTACT) gci->hContact = si->hContact;
if (gci->Flags & GCF_TYPE) gci->iType = si->iType;
if (gci->Flags & GCF_COUNT) gci->iCount = si->nUsersInNicklist;
- if (gci->Flags & GCF_USERS) gci->pszUsers = ci.SM_GetUsers(si);
+ if (gci->Flags & GCF_USERS) gci->pszUsers = chatApi.SM_GetUsers(si);
if (gci->Flags & GCF_ID) gci->pszID = si->ptszID;
if (gci->Flags & GCF_NAME) gci->pszName = si->ptszName;
return 0;
@@ -164,7 +164,7 @@ static INT_PTR Service_Register(WPARAM, LPARAM lParam)
return GC_REGISTER_WRONGVER;
mir_cslock lck(cs);
- MODULEINFO *mi = ci.MM_AddModule(gcr->pszModule);
+ MODULEINFO *mi = chatApi.MM_AddModule(gcr->pszModule);
if (mi == NULL)
return GC_REGISTER_ERROR;
@@ -185,10 +185,10 @@ static INT_PTR Service_Register(WPARAM, LPARAM lParam)
memcpy(mi->crColors, gcr->pColors, sizeof(COLORREF)* gcr->nColors);
}
- mi->pszHeader = ci.Log_CreateRtfHeader(mi);
+ mi->pszHeader = chatApi.Log_CreateRtfHeader(mi);
CheckColorsInModule((char*)gcr->pszModule);
- ci.SetAllOffline(TRUE, gcr->pszModule);
+ chatApi.SetAllOffline(TRUE, gcr->pszModule);
return 0;
}
@@ -202,28 +202,28 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam)
return GC_NEWSESSION_WRONGVER;
mir_cslock lck(cs);
- MODULEINFO *mi = ci.MM_FindModule(gcw->pszModule);
+ MODULEINFO *mi = chatApi.MM_FindModule(gcw->pszModule);
if (mi == NULL)
return GC_NEWSESSION_ERROR;
// try to restart a session first
- SESSION_INFO *si = ci.SM_FindSession(gcw->ptszID, gcw->pszModule);
- if (si != NULL) {
- ci.UM_RemoveAll(&si->pUsers);
- ci.TM_RemoveAll(&si->pStatuses);
+ SESSION_INFO *si = chatApi.SM_FindSession(gcw->ptszID, gcw->pszModule);
+ if (si != NULL) {
+ chatApi.UM_RemoveAll(&si->pUsers);
+ chatApi.TM_RemoveAll(&si->pStatuses);
si->iStatusCount = 0;
si->nUsersInNicklist = 0;
si->pMe = NULL;
- if (ci.OnReplaceSession)
- ci.OnReplaceSession(si);
+ if (chatApi.OnReplaceSession)
+ chatApi.OnReplaceSession(si);
return 0;
}
-
+
// create a new session and set the defaults
- if ((si = ci.SM_AddSession(gcw->ptszID, gcw->pszModule)) == NULL)
+ if ((si = chatApi.SM_AddSession(gcw->ptszID, gcw->pszModule)) == NULL)
return GC_NEWSESSION_ERROR;
si->dwItemData = gcw->dwItemData;
@@ -253,7 +253,7 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam)
mir_sntprintf(szTemp, _T("Server: %s"), si->ptszName);
else
_tcsncpy_s(szTemp, si->ptszName, _TRUNCATE);
- si->hContact = ci.AddRoom(gcw->pszModule, gcw->ptszID, szTemp, si->iType);
+ si->hContact = chatApi.AddRoom(gcw->pszModule, gcw->ptszID, szTemp, si->iType);
db_set_s(si->hContact, si->pszModule, "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
@@ -261,8 +261,8 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam)
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
- if (ci.OnCreateSession)
- ci.OnCreateSession(si, mi);
+ if (chatApi.OnCreateSession)
+ chatApi.OnCreateSession(si, mi);
return 0;
}
@@ -284,11 +284,11 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
if (gce->pDest->iType == GC_EVENT_CONTROL) {
switch (wp) {
case WINDOW_HIDDEN:
- if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
+ if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
SetInitDone(si);
- ci.SetActiveSession(si->ptszID, si->pszModule);
+ chatApi.SetActiveSession(si->ptszID, si->pszModule);
if (si->hWnd)
- ci.ShowRoom(si, wp, FALSE);
+ chatApi.ShowRoom(si, wp, FALSE);
}
return 0;
@@ -296,84 +296,84 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
case WINDOW_MAXIMIZE:
case WINDOW_VISIBLE:
case SESSION_INITDONE:
- if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
+ if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
SetInitDone(si);
if (wp != SESSION_INITDONE || db_get_b(NULL, CHAT_MODULE, "PopupOnJoin", 0) == 0)
- ci.ShowRoom(si, wp, TRUE);
+ chatApi.ShowRoom(si, wp, TRUE);
return 0;
}
break;
case SESSION_OFFLINE:
- ci.SM_SetOffline(gce->pDest->ptszID, gce->pDest->pszModule);
+ chatApi.SM_SetOffline(gce->pDest->ptszID, gce->pDest->pszModule);
// fall through
case SESSION_ONLINE:
- ci.SM_SetStatus(gce->pDest->ptszID, gce->pDest->pszModule, wp == SESSION_ONLINE ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
+ chatApi.SM_SetStatus(gce->pDest->ptszID, gce->pDest->pszModule, wp == SESSION_ONLINE ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
break;
case WINDOW_CLEARLOG:
- if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
- ci.LM_RemoveAll(&si->pLog, &si->pLogEnd);
- if (ci.OnClearLog)
- ci.OnClearLog(si);
+ if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
+ chatApi.LM_RemoveAll(&si->pLog, &si->pLogEnd);
+ if (chatApi.OnClearLog)
+ chatApi.OnClearLog(si);
si->iEventCount = 0;
si->LastTime = 0;
}
break;
case SESSION_TERMINATE:
- return ci.SM_RemoveSession(gce->pDest->ptszID, gce->pDest->pszModule, (gce->dwFlags & GCEF_REMOVECONTACT) != 0);
+ return chatApi.SM_RemoveSession(gce->pDest->ptszID, gce->pDest->pszModule, (gce->dwFlags & GCEF_REMOVECONTACT) != 0);
}
- ci.SM_SendMessage(gce->pDest->ptszID, gce->pDest->pszModule, GC_EVENT_CONTROL + WM_USER + 500, wp, 0);
+ chatApi.SM_SendMessage(gce->pDest->ptszID, gce->pDest->pszModule, GC_EVENT_CONTROL + WM_USER + 500, wp, 0);
}
else if (gce->pDest->iType == GC_EVENT_CHUID && gce->ptszText) {
- ci.SM_ChangeUID(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszNick, gce->ptszText);
+ chatApi.SM_ChangeUID(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszNick, gce->ptszText);
}
else if (gce->pDest->iType == GC_EVENT_CHANGESESSIONAME && gce->ptszText) {
- if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
+ if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
replaceStrT(si->ptszName, gce->ptszText);
if (si->hWnd)
SendMessage(si->hWnd, GC_UPDATETITLE, 0, 0);
- if (ci.OnRenameSession)
- ci.OnRenameSession(si);
+ if (chatApi.OnRenameSession)
+ chatApi.OnRenameSession(si);
}
}
else if (gce->pDest->iType == GC_EVENT_SETITEMDATA) {
- if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule))
+ if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule))
si->dwItemData = gce->dwItemData;
}
else if (gce->pDest->iType == GC_EVENT_GETITEMDATA) {
- if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
+ if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
gce->dwItemData = si->dwItemData;
return si->dwItemData;
}
return 0;
}
else if (gce->pDest->iType == GC_EVENT_SETSBTEXT) {
- if (si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
+ if (si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule)) {
replaceStrT(si->ptszStatusbarText, gce->ptszText);
if (si->ptszStatusbarText)
db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
- if (ci.OnSetStatusBar)
- ci.OnSetStatusBar(si);
+ if (chatApi.OnSetStatusBar)
+ chatApi.OnSetStatusBar(si);
}
}
else if (gce->pDest->iType == GC_EVENT_ACK) {
- ci.SM_SendMessage(gce->pDest->ptszID, gce->pDest->pszModule, GC_ACKMESSAGE, 0, 0);
+ chatApi.SM_SendMessage(gce->pDest->ptszID, gce->pDest->pszModule, GC_ACKMESSAGE, 0, 0);
}
else if (gce->pDest->iType == GC_EVENT_SENDMESSAGE && gce->ptszText) {
- ci.SM_SendUserMessage(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszText);
+ chatApi.SM_SendUserMessage(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszText);
}
else if (gce->pDest->iType == GC_EVENT_SETSTATUSEX) {
- ci.SM_SetStatusEx(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszText, gce->dwItemData);
+ chatApi.SM_SetStatusEx(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszText, gce->dwItemData);
}
else return 1;
@@ -382,11 +382,11 @@ static int DoControl(GCEVENT *gce, WPARAM wp)
static void AddUser(GCEVENT *gce)
{
- SESSION_INFO *si = ci.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
+ SESSION_INFO *si = chatApi.SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
if (si == NULL) return;
- WORD status = ci.TM_StringToWord(si->pStatuses, gce->ptszStatus);
- USERINFO *ui = ci.SM_AddUser(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID, gce->ptszNick, status);
+ WORD status = chatApi.TM_StringToWord(si->pStatuses, gce->ptszStatus);
+ USERINFO *ui = chatApi.SM_AddUser(gce->pDest->ptszID, gce->pDest->pszModule, gce->ptszUID, gce->ptszNick, status);
if (ui == NULL) return;
ui->pszNick = mir_tstrdup(gce->ptszNick);
@@ -395,8 +395,8 @@ static void AddUser(GCEVENT *gce)
ui->Status = status;
ui->Status |= si->pStatuses->Status;
- if (ci.OnNewUser)
- ci.OnNewUser(si, ui);
+ if (chatApi.OnNewUser)
+ chatApi.OnNewUser(si, ui);
}
static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
@@ -420,17 +420,16 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
NotifyEventHooks(hHookEvent, wParam, lParam);
- SESSION_INFO *si;
mir_cslock lck(cs);
// Do different things according to type of event
switch (gcd->iType) {
case GC_EVENT_ADDGROUP:
- {
- STATUSINFO *si = ci.SM_AddStatus(gcd->ptszID, gcd->pszModule, gce->ptszStatus);
- if (si && gce->dwItemData)
- si->hIcon = CopyIcon((HICON)gce->dwItemData);
- }
+ {
+ STATUSINFO *si = chatApi.SM_AddStatus(gcd->ptszID, gcd->pszModule, gce->ptszStatus);
+ if (si && gce->dwItemData)
+ si->hIcon = CopyIcon((HICON)gce->dwItemData);
+ }
return 0;
case GC_EVENT_CHUID:
@@ -445,15 +444,15 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
return DoControl(gce, wParam);
case GC_EVENT_SETCONTACTSTATUS:
- return ci.SM_SetContactStatus(gcd->ptszID, gcd->pszModule, gce->ptszUID, (WORD)gce->dwItemData);
+ return chatApi.SM_SetContactStatus(gcd->ptszID, gcd->pszModule, gce->ptszUID, (WORD)gce->dwItemData);
case GC_EVENT_TOPIC:
- if (si = ci.SM_FindSession(gcd->ptszID, gcd->pszModule)) {
+ if (SESSION_INFO *si = chatApi.SM_FindSession(gcd->ptszID, gcd->pszModule)) {
if (gce->ptszText) {
replaceStrT(si->ptszTopic, RemoveFormatting(gce->ptszText));
db_set_ts(si->hContact, si->pszModule, "Topic", si->ptszTopic);
- if (ci.OnSetTopic)
- ci.OnSetTopic(si);
+ if (chatApi.OnSetTopic)
+ chatApi.OnSetTopic(si);
if (db_get_b(NULL, CHAT_MODULE, "TopicOnClist", 0))
db_set_ts(si->hContact, "CList", "StatusMsg", si->ptszTopic);
}
@@ -461,38 +460,38 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
break;
case GC_EVENT_ADDSTATUS:
- ci.SM_GiveStatus(gcd->ptszID, gcd->pszModule, gce->ptszUID, gce->ptszStatus);
- bIsHighlighted = ci.IsHighlighted(NULL, gce);
+ chatApi.SM_GiveStatus(gcd->ptszID, gcd->pszModule, gce->ptszUID, gce->ptszStatus);
+ bIsHighlighted = chatApi.IsHighlighted(NULL, gce);
break;
case GC_EVENT_REMOVESTATUS:
- ci.SM_TakeStatus(gcd->ptszID, gcd->pszModule, gce->ptszUID, gce->ptszStatus);
- bIsHighlighted = ci.IsHighlighted(NULL, gce);
+ chatApi.SM_TakeStatus(gcd->ptszID, gcd->pszModule, gce->ptszUID, gce->ptszStatus);
+ bIsHighlighted = chatApi.IsHighlighted(NULL, gce);
break;
case GC_EVENT_MESSAGE:
case GC_EVENT_ACTION:
if (!gce->bIsMe && gcd->ptszID && gce->ptszText) {
- si = ci.SM_FindSession(gcd->ptszID, gcd->pszModule);
- bIsHighlighted = ci.IsHighlighted(si, gce);
+ SESSION_INFO *si = chatApi.SM_FindSession(gcd->ptszID, gcd->pszModule);
+ bIsHighlighted = chatApi.IsHighlighted(si, gce);
}
break;
case GC_EVENT_NICK:
- ci.SM_ChangeNick(gcd->ptszID, gcd->pszModule, gce);
- bIsHighlighted = ci.IsHighlighted(NULL, gce);
+ chatApi.SM_ChangeNick(gcd->ptszID, gcd->pszModule, gce);
+ bIsHighlighted = chatApi.IsHighlighted(NULL, gce);
break;
case GC_EVENT_JOIN:
AddUser(gce);
- bIsHighlighted = ci.IsHighlighted(NULL, gce);
+ bIsHighlighted = chatApi.IsHighlighted(NULL, gce);
break;
case GC_EVENT_PART:
case GC_EVENT_QUIT:
case GC_EVENT_KICK:
bRemoveFlag = TRUE;
- bIsHighlighted = ci.IsHighlighted(NULL, gce);
+ bIsHighlighted = chatApi.IsHighlighted(NULL, gce);
break;
}
@@ -504,7 +503,7 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
pMod = gcd->pszModule;
}
else if (gcd->iType == GC_EVENT_NOTICE || gcd->iType == GC_EVENT_INFORMATION) {
- si = ci.GetActiveSession();
+ SESSION_INFO *si = chatApi.GetActiveSession();
if (si && !mir_strcmp(si->pszModule, gcd->pszModule)) {
pWnd = si->ptszID;
pMod = si->pszModule;
@@ -513,14 +512,14 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
}
else {
// Send the event to all windows with a user pszUID. Used for broadcasting QUIT etc
- ci.SM_AddEventToAllMatchingUID(gce);
+ chatApi.SM_AddEventToAllMatchingUID(gce);
if (!bRemoveFlag)
return 0;
}
// add to log
if (pWnd) {
- si = ci.SM_FindSession(pWnd, pMod);
+ SESSION_INFO *si = chatApi.SM_FindSession(pWnd, pMod);
// fix for IRC's old stuyle mode notifications. Should not affect any other protocol
if ((gcd->iType == GC_EVENT_ADDSTATUS || gcd->iType == GC_EVENT_REMOVESTATUS) && !(gce->dwFlags & GCEF_ADDTOLOG))
@@ -530,13 +529,13 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
return 0;
if (si && (si->bInitDone || gcd->iType == GC_EVENT_TOPIC || (gcd->iType == GC_EVENT_JOIN && gce->bIsMe))) {
- int isOk = ci.SM_AddEvent(pWnd, pMod, gce, bIsHighlighted);
- if (ci.OnAddLog)
- ci.OnAddLog(si, isOk);
+ int isOk = chatApi.SM_AddEvent(pWnd, pMod, gce, bIsHighlighted);
+ if (chatApi.OnAddLog)
+ chatApi.OnAddLog(si, isOk);
if (!(gce->dwFlags & GCEF_NOTNOTIFY))
- ci.DoSoundsFlashPopupTrayStuff(si, gce, bIsHighlighted, 0);
+ chatApi.DoSoundsFlashPopupTrayStuff(si, gce, bIsHighlighted, 0);
if ((gce->dwFlags & GCEF_ADDTOLOG) && g_Settings->bLoggingEnabled)
- ci.LogToFile(si, gce);
+ chatApi.LogToFile(si, gce);
}
if (!bRemoveFlag)
@@ -544,7 +543,7 @@ static INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
}
if (bRemoveFlag)
- return ci.SM_RemoveUser(gcd->ptszID, gcd->pszModule, gce->ptszUID) == 0;
+ return chatApi.SM_RemoveUser(gcd->ptszID, gcd->pszModule, gce->ptszUID) == 0;
return GC_EVENT_ERROR;
}
@@ -580,7 +579,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
mi.pszService = "GChat/LeaveChat";
hLeaveMenuItem = Menu_AddContactMenuItem(&mi);
- ci.SetAllOffline(TRUE, NULL);
+ chatApi.SetAllOffline(TRUE, NULL);
return 0;
}
@@ -608,8 +607,8 @@ int LoadChatModule(void)
CreateServiceFunction("GChat/LeaveChat", LeaveChat);
CreateServiceFunction("GChat/GetInterface", SvcGetChatManager);
- ci.hSendEvent = CreateHookableEvent(ME_GC_EVENT);
- ci.hBuildMenuEvent = CreateHookableEvent(ME_GC_BUILDMENU);
+ chatApi.hSendEvent = CreateHookableEvent(ME_GC_EVENT);
+ chatApi.hBuildMenuEvent = CreateHookableEvent(ME_GC_BUILDMENU);
hHookEvent = CreateHookableEvent(ME_GC_HOOK_EVENT);
HookEvent(ME_FONT_RELOAD, FontsChanged);
@@ -624,13 +623,13 @@ void UnloadChatModule(void)
if (!bInited)
return;
- mir_free(ci.szActiveWndID);
- mir_free(ci.szActiveWndModule);
+ mir_free(chatApi.szActiveWndID);
+ mir_free(chatApi.szActiveWndModule);
FreeMsgLogBitmaps();
OptionsUnInit();
- DestroyHookableEvent(ci.hSendEvent);
- DestroyHookableEvent(ci.hBuildMenuEvent);
+ DestroyHookableEvent(chatApi.hSendEvent);
+ DestroyHookableEvent(chatApi.hBuildMenuEvent);
DestroyHookableEvent(hHookEvent);
}
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 6d2c7f0a66..0ba4c381c8 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -85,43 +85,43 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce)
switch (gce->pDest->iType) {
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
- ci.AddEvent(si->hContact, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), GC_FAKE_EVENT, 0, TranslateT("%s wants your attention in %s"), gce->ptszNick, si->ptszName);
+ chatApi.AddEvent(si->hContact, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), GC_FAKE_EVENT, 0, TranslateT("%s wants your attention in %s"), gce->ptszNick, si->ptszName);
break;
case GC_EVENT_MESSAGE:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_MESSAGE], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s speaks in %s"), gce->ptszNick, si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_MESSAGE], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s speaks in %s"), gce->ptszNick, si->ptszName);
break;
case GC_EVENT_ACTION:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_ACTION], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s speaks in %s"), gce->ptszNick, si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_ACTION], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s speaks in %s"), gce->ptszNick, si->ptszName);
break;
case GC_EVENT_JOIN:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_JOIN], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s has joined %s"), gce->ptszNick, si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_JOIN], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s has joined %s"), gce->ptszNick, si->ptszName);
break;
case GC_EVENT_PART:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_PART], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s has left %s"), gce->ptszNick, si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_PART], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s has left %s"), gce->ptszNick, si->ptszName);
break;
case GC_EVENT_QUIT:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_QUIT], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s has disconnected"), gce->ptszNick);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_QUIT], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s has disconnected"), gce->ptszNick);
break;
case GC_EVENT_NICK:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_NICK], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s is now known as %s"), gce->ptszNick, gce->ptszText);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_NICK], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s is now known as %s"), gce->ptszNick, gce->ptszText);
break;
case GC_EVENT_KICK:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_KICK], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s kicked %s from %s"), gce->ptszStatus, gce->ptszNick, si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_KICK], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s kicked %s from %s"), gce->ptszStatus, gce->ptszNick, si->ptszName);
break;
case GC_EVENT_NOTICE:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_NOTICE], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("Notice from %s"), gce->ptszNick);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_NOTICE], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("Notice from %s"), gce->ptszNick);
break;
case GC_EVENT_TOPIC:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_TOPIC], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("Topic change in %s"), si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_TOPIC], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("Topic change in %s"), si->ptszName);
break;
case GC_EVENT_INFORMATION:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_INFO], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("Information in %s"), si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_INFO], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("Information in %s"), si->ptszName);
break;
case GC_EVENT_ADDSTATUS:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_ADDSTATUS], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s enables '%s' status for %s in %s"), gce->ptszText, gce->ptszStatus, gce->ptszNick, si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_ADDSTATUS], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s enables '%s' status for %s in %s"), gce->ptszText, gce->ptszStatus, gce->ptszNick, si->ptszName);
break;
case GC_EVENT_REMOVESTATUS:
- ci.AddEvent(si->hContact, ci.hIcons[ICON_REMSTATUS], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s disables '%s' status for %s in %s"), gce->ptszText, gce->ptszStatus, gce->ptszNick, si->ptszName);
+ chatApi.AddEvent(si->hContact, chatApi.hIcons[ICON_REMSTATUS], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s disables '%s' status for %s in %s"), gce->ptszText, gce->ptszStatus, gce->ptszNick, si->ptszName);
break;
}
@@ -133,7 +133,7 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce)
static void __stdcall ShowRoomFromPopup(void *pi)
{
SESSION_INFO *si = (SESSION_INFO*)pi;
- ci.ShowRoom(si, WINDOW_VISIBLE, TRUE);
+ chatApi.ShowRoom(si, WINDOW_VISIBLE, TRUE);
}
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
@@ -213,58 +213,58 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
{
switch (gce->pDest->iType) {
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
- ci.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, chatApi.aFonts[16].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
- ci.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, chatApi.aFonts[16].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_MESSAGE:
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_MESSAGE], si->pszModule, si->ptszName, ci.aFonts[9].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_MESSAGE], si->pszModule, si->ptszName, chatApi.aFonts[9].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_ACTION:
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_ACTION], si->pszModule, si->ptszName, ci.aFonts[15].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_ACTION], si->pszModule, si->ptszName, chatApi.aFonts[15].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_JOIN:
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_JOIN], si->pszModule, si->ptszName, ci.aFonts[3].color, TranslateT("%s has joined"), gce->ptszNick);
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_JOIN], si->pszModule, si->ptszName, chatApi.aFonts[3].color, TranslateT("%s has joined"), gce->ptszNick);
break;
case GC_EVENT_PART:
if (!gce->ptszText)
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_PART], si->pszModule, si->ptszName, ci.aFonts[4].color, TranslateT("%s has left"), gce->ptszNick);
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_PART], si->pszModule, si->ptszName, chatApi.aFonts[4].color, TranslateT("%s has left"), gce->ptszNick);
else
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_PART], si->pszModule, si->ptszName, ci.aFonts[4].color, TranslateT("%s has left (%s)"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_PART], si->pszModule, si->ptszName, chatApi.aFonts[4].color, TranslateT("%s has left (%s)"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_QUIT:
if (!gce->ptszText)
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_QUIT], si->pszModule, si->ptszName, ci.aFonts[5].color, TranslateT("%s has disconnected"), gce->ptszNick);
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_QUIT], si->pszModule, si->ptszName, chatApi.aFonts[5].color, TranslateT("%s has disconnected"), gce->ptszNick);
else
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_QUIT], si->pszModule, si->ptszName, ci.aFonts[5].color, TranslateT("%s has disconnected (%s)"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_QUIT], si->pszModule, si->ptszName, chatApi.aFonts[5].color, TranslateT("%s has disconnected (%s)"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_NICK:
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_NICK], si->pszModule, si->ptszName, ci.aFonts[7].color, TranslateT("%s is now known as %s"), gce->ptszNick, gce->ptszText);
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_NICK], si->pszModule, si->ptszName, chatApi.aFonts[7].color, TranslateT("%s is now known as %s"), gce->ptszNick, gce->ptszText);
break;
case GC_EVENT_KICK:
if (!gce->ptszText)
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_KICK], si->pszModule, si->ptszName, ci.aFonts[6].color, TranslateT("%s kicked %s"), (char *)gce->ptszStatus, gce->ptszNick);
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_KICK], si->pszModule, si->ptszName, chatApi.aFonts[6].color, TranslateT("%s kicked %s"), (char *)gce->ptszStatus, gce->ptszNick);
else
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_KICK], si->pszModule, si->ptszName, ci.aFonts[6].color, TranslateT("%s kicked %s (%s)"), (char *)gce->ptszStatus, gce->ptszNick, RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_KICK], si->pszModule, si->ptszName, chatApi.aFonts[6].color, TranslateT("%s kicked %s (%s)"), (char *)gce->ptszStatus, gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_NOTICE:
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_NOTICE], si->pszModule, si->ptszName, ci.aFonts[8].color, TranslateT("Notice from %s: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_NOTICE], si->pszModule, si->ptszName, chatApi.aFonts[8].color, TranslateT("Notice from %s: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_TOPIC:
if (!gce->ptszNick)
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_TOPIC], si->pszModule, si->ptszName, ci.aFonts[11].color, TranslateT("The topic is '%s'"), RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_TOPIC], si->pszModule, si->ptszName, chatApi.aFonts[11].color, TranslateT("The topic is '%s'"), RemoveFormatting(gce->ptszText));
else
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_TOPIC], si->pszModule, si->ptszName, ci.aFonts[11].color, TranslateT("The topic is '%s' (set by %s)"), RemoveFormatting(gce->ptszText), gce->ptszNick);
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_TOPIC], si->pszModule, si->ptszName, chatApi.aFonts[11].color, TranslateT("The topic is '%s' (set by %s)"), RemoveFormatting(gce->ptszText), gce->ptszNick);
break;
case GC_EVENT_INFORMATION:
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_INFO], si->pszModule, si->ptszName, ci.aFonts[12].color, _T("%s"), RemoveFormatting(gce->ptszText));
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_INFO], si->pszModule, si->ptszName, chatApi.aFonts[12].color, _T("%s"), RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_ADDSTATUS:
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_ADDSTATUS], si->pszModule, si->ptszName, ci.aFonts[13].color, TranslateT("%s enables '%s' status for %s"), gce->ptszText, (char *)gce->ptszStatus, gce->ptszNick);
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_ADDSTATUS], si->pszModule, si->ptszName, chatApi.aFonts[13].color, TranslateT("%s enables '%s' status for %s"), gce->ptszText, (char *)gce->ptszStatus, gce->ptszNick);
break;
case GC_EVENT_REMOVESTATUS:
- ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_REMSTATUS], si->pszModule, si->ptszName, ci.aFonts[14].color, TranslateT("%s disables '%s' status for %s"), gce->ptszText, (char *)gce->ptszStatus, gce->ptszNick);
+ chatApi.ShowPopup(si->hContact, si, chatApi.hIcons[ICON_REMSTATUS], si->pszModule, si->ptszName, chatApi.aFonts[14].color, TranslateT("%s disables '%s' status for %s"), gce->ptszText, (char *)gce->ptszStatus, gce->ptszNick);
break;
}
@@ -287,23 +287,23 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
if (db_get_b(si->hContact, "CList", "Hidden", 0) != 0)
db_unset(si->hContact, "CList", "Hidden");
if (bInactive)
- ci.DoTrayIcon(si, gce);
+ chatApi.DoTrayIcon(si, gce);
if (bInactive || !g_Settings->bPopupInactiveOnly)
- ci.DoPopup(si, gce);
- if (ci.OnFlashHighlight)
- ci.OnFlashHighlight(si, bInactive);
+ chatApi.DoPopup(si, gce);
+ if (chatApi.OnFlashHighlight)
+ chatApi.OnFlashHighlight(si, bInactive);
return TRUE;
}
// do blinking icons in tray
if (bInactive || !g_Settings->bTrayIconInactiveOnly)
- ci.DoTrayIcon(si, gce);
+ chatApi.DoTrayIcon(si, gce);
// stupid thing to not create multiple popups for a QUIT event for instance
if (bManyFix == 0) {
// do popups
if (bInactive || !g_Settings->bPopupInactiveOnly)
- ci.DoPopup(si, gce);
+ chatApi.DoPopup(si, gce);
// do sounds and flashing
switch (iEvent) {
@@ -336,8 +336,8 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
si->wState |= STATE_TALK;
db_set_w(si->hContact, si->pszModule, "ApparentMode", ID_STATUS_OFFLINE);
}
- if (ci.OnFlashWindow)
- ci.OnFlashWindow(si, bInactive);
+ if (chatApi.OnFlashWindow)
+ chatApi.OnFlashWindow(si, bInactive);
break;
case GC_EVENT_ACTION:
if (bInactive || !g_Settings->bSoundsFocus)
@@ -363,7 +363,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
int GetColorIndex(const char *pszModule, COLORREF cr)
{
- MODULEINFO *pMod = ci.MM_FindModule(pszModule);
+ MODULEINFO *pMod = chatApi.MM_FindModule(pszModule);
int i = 0;
if (!pMod || pMod->nColorCount == 0)
@@ -383,7 +383,7 @@ int GetColorIndex(const char *pszModule, COLORREF cr)
void CheckColorsInModule(const char *pszModule)
{
- MODULEINFO *pMod = ci.MM_FindModule(pszModule);
+ MODULEINFO *pMod = chatApi.MM_FindModule(pszModule);
int i = 0;
COLORREF crFG;
COLORREF crBG = (COLORREF)db_get_dw(NULL, CHAT_MODULE, "ColorMessageBG", GetSysColor(COLOR_WINDOW));
@@ -471,7 +471,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
CreateDirectoryTreeT(tszFolder);
TCHAR szTime[100];
- mir_tstrncpy(szTime, ci.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
+ mir_tstrncpy(szTime, chatApi.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
FILE *hFile = _tfopen(si->pszLogFileName, _T("ab+"));
if (hFile == NULL)
@@ -499,12 +499,12 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
case GC_EVENT_MESSAGE:
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
p = '*';
- mir_sntprintf(szBuffer, _T("%s: %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, _T("%s: %s"), gce->ptszNick, chatApi.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_ACTION:
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
p = '*';
- mir_sntprintf(szBuffer, _T("%s %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, _T("%s %s"), gce->ptszNick, chatApi.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_JOIN:
p = '>';
@@ -515,14 +515,14 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
if (!gce->ptszText)
mir_sntprintf(szBuffer, TranslateT("%s has left"), pszNick);
else
- mir_sntprintf(szBuffer, TranslateT("%s has left (%s)"), pszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("%s has left (%s)"), pszNick, chatApi.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_QUIT:
p = '<';
if (!gce->ptszText)
mir_sntprintf(szBuffer, TranslateT("%s has disconnected"), pszNick);
else
- mir_sntprintf(szBuffer, TranslateT("%s has disconnected (%s)"), pszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("%s has disconnected (%s)"), pszNick, chatApi.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_NICK:
p = '^';
@@ -533,22 +533,22 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
if (!gce->ptszText)
mir_sntprintf(szBuffer, TranslateT("%s kicked %s"), gce->ptszStatus, gce->ptszNick);
else
- mir_sntprintf(szBuffer, TranslateT("%s kicked %s (%s)"), gce->ptszStatus, gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("%s kicked %s (%s)"), gce->ptszStatus, gce->ptszNick, chatApi.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_NOTICE:
p = 'o';
- mir_sntprintf(szBuffer, TranslateT("Notice from %s: %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("Notice from %s: %s"), gce->ptszNick, chatApi.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_TOPIC:
p = '#';
if (!gce->ptszNick)
- mir_sntprintf(szBuffer, TranslateT("The topic is '%s'"), ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("The topic is '%s'"), chatApi.RemoveFormatting(gce->ptszText));
else
- mir_sntprintf(szBuffer, TranslateT("The topic is '%s' (set by %s)"), ci.RemoveFormatting(gce->ptszText), gce->ptszNick);
+ mir_sntprintf(szBuffer, TranslateT("The topic is '%s' (set by %s)"), chatApi.RemoveFormatting(gce->ptszText), gce->ptszNick);
break;
case GC_EVENT_INFORMATION:
p = '!';
- _tcsncpy_s(szBuffer, ci.RemoveFormatting(gce->ptszText), _TRUNCATE);
+ _tcsncpy_s(szBuffer, chatApi.RemoveFormatting(gce->ptszText), _TRUNCATE);
break;
case GC_EVENT_ADDSTATUS:
p = '+';
@@ -611,7 +611,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char *pszModule, int iType, const TCHAR* pszUID, const TCHAR* pszText, INT_PTR dwItem)
{
- SESSION_INFO *si = ci.SM_FindSession(pszID, pszModule);
+ SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si == NULL)
return FALSE;
@@ -631,7 +631,7 @@ BOOL DoEventHookAsync(HWND hwnd, const TCHAR *pszID, const char *pszModule, int
BOOL DoEventHook(const TCHAR *pszID, const char *pszModule, int iType, const TCHAR *pszUID, const TCHAR* pszText, INT_PTR dwItem)
{
- SESSION_INFO *si = ci.SM_FindSession(pszID, pszModule);
+ SESSION_INFO *si = chatApi.SM_FindSession(pszID, pszModule);
if (si == NULL)
return FALSE;
@@ -641,7 +641,7 @@ BOOL DoEventHook(const TCHAR *pszID, const char *pszModule, int iType, const TCH
gch.ptszText = (LPTSTR)pszText;
gch.dwData = dwItem;
gch.pDest = &gcd;
- NotifyEventHooks(ci.hSendEvent, 0, (WPARAM)&gch);
+ NotifyEventHooks(chatApi.hSendEvent, 0, (WPARAM)&gch);
return TRUE;
}
@@ -699,7 +699,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
// check whether relevant parts of the timestamp have changed and
// we have to reparse the filename
- TCHAR *tszNow = ci.MakeTimeStamp(_T("%a%d%m%Y"), tTime); // once a day
+ TCHAR *tszNow = chatApi.MakeTimeStamp(_T("%a%d%m%Y"), tTime); // once a day
if (mir_tstrcmp(tszOldTimeStamp, tszNow)) {
_tcsncpy_s(tszOldTimeStamp, tszNow, _TRUNCATE);
*si->pszLogFileName = 0;
@@ -708,34 +708,34 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
if (si->pszLogFileName[0] == 0) {
REPLACEVARSARRAY rva[11];
rva[0].key.t = _T("d");
- rva[0].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%#d"), tTime));
+ rva[0].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%#d"), tTime));
// day 01-31
rva[1].key.t = _T("dd");
- rva[1].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%d"), tTime));
+ rva[1].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%d"), tTime));
// month 1-12
rva[2].key.t = _T("m");
- rva[2].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%#m"), tTime));
+ rva[2].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%#m"), tTime));
// month 01-12
rva[3].key.t = _T("mm");
- rva[3].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%m"), tTime));
+ rva[3].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%m"), tTime));
// month text short
rva[4].key.t = _T("mon");
- rva[4].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%b"), tTime));
+ rva[4].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%b"), tTime));
// month text
rva[5].key.t = _T("month");
- rva[5].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%B"), tTime));
+ rva[5].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%B"), tTime));
// year 01-99
rva[6].key.t = _T("yy");
- rva[6].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%y"), tTime));
+ rva[6].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%y"), tTime));
// year 1901-9999
rva[7].key.t = _T("yyyy");
- rva[7].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%Y"), tTime));
+ rva[7].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%Y"), tTime));
// weekday short
rva[8].key.t = _T("wday");
- rva[8].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%a"), tTime));
+ rva[8].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%a"), tTime));
// weekday
rva[9].key.t = _T("weekday");
- rva[9].value.t = mir_tstrdup(ci.MakeTimeStamp(_T("%A"), tTime));
+ rva[9].value.t = mir_tstrdup(chatApi.MakeTimeStamp(_T("%A"), tTime));
// end of array
rva[10].key.t = NULL;
rva[10].value.t = NULL;
@@ -748,8 +748,8 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
else ptszVarPath = g_Settings->pszLogDir;
TCHAR *tszParsedName = Utils_ReplaceVarsT(ptszVarPath, si->hContact, rva);
- if (ci.OnGetLogName)
- ci.OnGetLogName(si, tszParsedName);
+ if (chatApi.OnGetLogName)
+ chatApi.OnGetLogName(si, tszParsedName);
else
PathToAbsoluteT(tszParsedName, si->pszLogFileName);
mir_free(tszParsedName);
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp
index 29b71a2a5a..c57e0642e6 100644
--- a/src/mir_app/src/clistevents.cpp
+++ b/src/mir_app/src/clistevents.cpp
@@ -209,7 +209,7 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent)
//count same protocoled events
int nSameProto = 0;
char *szEventProto;
- for (int i = 0; i < cli.events.count; i++) {
+ for (i = 0; i < cli.events.count; i++) {
if (cli.events.items[i]->cle.hContact)
szEventProto = GetContactProto((cli.events.items[i]->cle.hContact));
else if (cli.events.items[i]->cle.flags & CLEF_PROTOCOLGLOBAL)
diff --git a/src/mir_app/src/colorchooser.cpp b/src/mir_app/src/colorchooser.cpp
index 56dd57c3a9..d272c42514 100644
--- a/src/mir_app/src/colorchooser.cpp
+++ b/src/mir_app/src/colorchooser.cpp
@@ -274,7 +274,7 @@ void ColorChooser(SESSION_INFO *si, BOOL bFG, HWND hwndDlg, HWND hwndTarget, HWN
COLORCHOOSER *pCC = (COLORCHOOSER *)mir_alloc(sizeof(COLORCHOOSER));
pCC->hWndTarget = hwndTarget;
- pCC->pModule = ci.MM_FindModule(si->pszModule);
+ pCC->pModule = chatApi.MM_FindModule(si->pszModule);
pCC->xPosition = rc.left + 3;
pCC->yPosition = IsWindowVisible(hwndChooser) ? rc.top - 1 : rc.top + 20;
pCC->bForeground = bFG;
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp
index 59fa3bfb3d..3c1fe00047 100644
--- a/src/mir_app/src/extraicons.cpp
+++ b/src/mir_app/src/extraicons.cpp
@@ -151,12 +151,12 @@ static void LoadGroups(LIST<ExtraIconGroup> &groups)
if (extra == NULL)
continue;
- group->items.insert(extra);
+ group->m_items.insert(extra);
if (extra->getSlot() >= 0)
group->setSlot(extra->getSlot());
}
- if (group->items.getCount() < 2) {
+ if (group->m_items.getCount() < 2) {
delete group;
continue;
}
@@ -169,8 +169,8 @@ static ExtraIconGroup* IsInGroup(LIST<ExtraIconGroup> &groups, BaseExtraIcon *ex
{
for (int i = 0; i < groups.getCount(); i++) {
ExtraIconGroup *group = groups[i];
- for (int j = 0; j < group->items.getCount(); j++) {
- if (extra == group->items[j])
+ for (int j = 0; j < group->m_items.getCount(); j++) {
+ if (extra == group->m_items[j])
return group;
}
}
@@ -194,8 +194,8 @@ void RebuildListsBasedOnGroups(LIST<ExtraIconGroup> &groups)
for (int i=0; i < groups.getCount(); i++) {
ExtraIconGroup *group = groups[i];
- for (int j = 0; j < group->items.getCount(); j++)
- extraIconsByHandle.put(group->items[j]->getID()-1, group);
+ for (int j = 0; j < group->m_items.getCount(); j++)
+ extraIconsByHandle.put(group->m_items[j]->getID()-1, group);
extraIconsBySlot.insert(group);
}
@@ -209,13 +209,13 @@ void RebuildListsBasedOnGroups(LIST<ExtraIconGroup> &groups)
///////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleExtraIcons(int hLangpack)
+MIR_APP_DLL(void) KillModuleExtraIcons(int _hLang)
{
LIST<ExtraIcon> arDeleted(1);
for (int i=registeredExtraIcons.getCount()-1; i >= 0; i--) {
BaseExtraIcon *p = registeredExtraIcons[i];
- if (p->hLangpack == hLangpack) {
+ if (p->m_hLangpack == _hLang) {
registeredExtraIcons.remove(i);
arDeleted.insert(p);
}
@@ -345,7 +345,7 @@ void fnSetAllExtraIcons(MCONTACT hContact)
///////////////////////////////////////////////////////////////////////////////
// Services
-static void EI_PostCreate(BaseExtraIcon *extra, const char *name, int hLangpack)
+static void EI_PostCreate(BaseExtraIcon *extra, const char *name, int _hLang)
{
char setting[512];
mir_snprintf(setting, "Position_%s", name);
@@ -357,7 +357,7 @@ static void EI_PostCreate(BaseExtraIcon *extra, const char *name, int hLangpack)
slot = -1;
extra->setSlot(slot);
- extra->hLangpack = hLangpack;
+ extra->m_hLangpack = _hLang;
registeredExtraIcons.insert(extra);
extraIconsByHandle.insert(extra);
@@ -396,7 +396,7 @@ static void EI_PostCreate(BaseExtraIcon *extra, const char *name, int hLangpack)
EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const char *description, const char *descIcon,
MIRANDAHOOK RebuildIcons, MIRANDAHOOK ApplyIcon,
- MIRANDAHOOKPARAM OnClick, LPARAM onClickParam, int hLangpack)
+ MIRANDAHOOKPARAM OnClick, LPARAM onClickParam, int _hLang)
{
// EXTRAICON_TYPE_CALLBACK
if (IsEmpty(name) || IsEmpty(description))
@@ -410,22 +410,22 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterCallback(const char *name, const
return 0;
ptrT tszDesc(mir_a2t(description));
- TCHAR *desc = TranslateTH(hLangpack, tszDesc);
+ TCHAR *desc = TranslateTH(_hLang, tszDesc);
int id = registeredExtraIcons.getCount() + 1;
BaseExtraIcon *extra = new CallbackExtraIcon(id, name, desc, descIcon == NULL ? "" : descIcon, RebuildIcons, ApplyIcon, OnClick, onClickParam);
- EI_PostCreate(extra, name, hLangpack);
+ EI_PostCreate(extra, name, _hLang);
return (HANDLE)id;
}
EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const char *description, const char *descIcon,
- MIRANDAHOOKPARAM OnClick, LPARAM onClickParam, int hLangpack)
+ MIRANDAHOOKPARAM OnClick, LPARAM onClickParam, int _hLang)
{
if (IsEmpty(name) || IsEmpty(description))
return 0;
ptrT tszDesc(mir_a2t(description));
- TCHAR *desc = TranslateTH(hLangpack, tszDesc);
+ TCHAR *desc = TranslateTH(_hLang, tszDesc);
BaseExtraIcon *extra = GetExtraIconByName(name);
if (extra != NULL) {
@@ -458,7 +458,7 @@ EXTERN_C MIR_APP_DLL(HANDLE) ExtraIcon_RegisterIcolib(const char *name, const ch
int id = registeredExtraIcons.getCount() + 1;
extra = new IcolibExtraIcon(id, name, desc, descIcon == NULL ? "" : descIcon, OnClick, onClickParam);
- EI_PostCreate(extra, name, hLangpack);
+ EI_PostCreate(extra, name, _hLang);
return (HANDLE)id;
}
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h
index d74cee61db..8cb0ffcd26 100644
--- a/src/mir_app/src/miranda.h
+++ b/src/mir_app/src/miranda.h
@@ -46,6 +46,10 @@ typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
extern pfnDwmExtendFrameIntoClientArea dwmExtendFrameIntoClientArea;
extern pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
+/**** chat.cpp *************************************************************************/
+
+extern struct CHAT_MANAGER chatApi;
+
/**** database.cpp *********************************************************************/
extern MIDatabase* currDb;
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp
index 403f76d297..0f7be68f96 100644
--- a/src/mir_app/src/options_ei.cpp
+++ b/src/mir_app/src/options_ei.cpp
@@ -284,8 +284,8 @@ public:
if (extra->getType() == EXTRAICON_TYPE_GROUP) {
ExtraIconGroup *group = (ExtraIconGroup *)extra;
intlist ids;
- for (int j = 0; j < group->items.getCount(); j++)
- ids.add(group->items[j]->getID());
+ for (int j = 0; j < group->m_items.getCount(); j++)
+ ids.add(group->m_items[j]->getID());
Tree_AddExtraIconGroup(ids, extra->isEnabled());
}
else Tree_AddExtraIcon((BaseExtraIcon *)extra, extra->isEnabled());
@@ -379,10 +379,10 @@ public:
char setting[512];
mir_snprintf(setting, "%d_count", k);
- db_set_w(NULL, MODULE_NAME "Groups", setting, (WORD)group->items.getCount());
+ db_set_w(NULL, MODULE_NAME "Groups", setting, (WORD)group->m_items.getCount());
- for (int j = 0; j < group->items.getCount(); j++) {
- BaseExtraIcon *extra = group->items[j];
+ for (int j = 0; j < group->m_items.getCount(); j++) {
+ BaseExtraIcon *extra = group->m_items[j];
mir_snprintf(setting, "%d_%d", k, j);
db_set_s(NULL, MODULE_NAME "Groups", setting, extra->getName());
diff --git a/src/mir_app/src/services.cpp b/src/mir_app/src/services.cpp
index c074526c4a..f890c8ec2d 100644
--- a/src/mir_app/src/services.cpp
+++ b/src/mir_app/src/services.cpp
@@ -238,7 +238,7 @@ void UpdateFontSettings(FontIDW *font_id, FontSettingsT *fontsettings)
/////////////////////////////////////////////////////////////////////////////////////////
// RegisterFont service
-static int sttRegisterFontWorker(FontIDW *font_id, int hLangpack)
+static int sttRegisterFontWorker(FontIDW *font_id, int _hLang)
{
if (font_id->cbSize != sizeof(FontIDW) && font_id->cbSize != FontIDW_OLDSIZE)
return -1;
@@ -256,7 +256,7 @@ static int sttRegisterFontWorker(FontIDW *font_id, int hLangpack)
FontInternal* newItem = new FontInternal;
memset(newItem, 0, sizeof(FontInternal));
memcpy(newItem, font_id, font_id->cbSize);
- newItem->hLangpack = hLangpack;
+ newItem->hLangpack = _hLang;
if (!mir_tstrcmp(newItem->deffontsettings.szFace, _T("MS Shell Dlg"))) {
LOGFONT lf;
@@ -325,10 +325,10 @@ INT_PTR GetFont(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleFonts(int hLangpack)
+MIR_APP_DLL(void) KillModuleFonts(int _hLang)
{
for (int i = font_id_list.getCount() - 1; i >= 0; i--)
- if (font_id_list[i].hLangpack == hLangpack)
+ if (font_id_list[i].hLangpack == _hLang)
font_id_list.remove(i);
}
@@ -340,7 +340,7 @@ void UpdateColourSettings(ColourIDW *colour_id, COLORREF *colour)
*colour = (COLORREF)db_get_dw(NULL, colour_id->dbSettingsGroup, colour_id->setting, colour_id->defcolour);
}
-static INT_PTR sttRegisterColourWorker(ColourIDW *colour_id, int hLangpack)
+static INT_PTR sttRegisterColourWorker(ColourIDW *colour_id, int _hLang)
{
if (colour_id->cbSize != sizeof(ColourIDW))
return -1;
@@ -354,7 +354,7 @@ static INT_PTR sttRegisterColourWorker(ColourIDW *colour_id, int hLangpack)
ColourInternal* newItem = new ColourInternal;
memset(newItem, 0, sizeof(ColourInternal));
memcpy(newItem, colour_id, sizeof(ColourIDW));
- newItem->hLangpack = hLangpack;
+ newItem->hLangpack = _hLang;
UpdateColourSettings(colour_id, &newItem->value);
colour_id_list.insert(newItem);
return 0;
@@ -400,10 +400,10 @@ INT_PTR GetColour(WPARAM wParam, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleColours(int hLangpack)
+MIR_APP_DLL(void) KillModuleColours(int _hLang)
{
for (int i = colour_id_list.getCount() - 1; i >= 0; i--)
- if (colour_id_list[i].hLangpack == hLangpack)
+ if (colour_id_list[i].hLangpack == _hLang)
colour_id_list.remove(i);
}
@@ -426,7 +426,7 @@ void UpdateEffectSettings(EffectIDW *effect_id, FONTEFFECT *effectsettings)
/////////////////////////////////////////////////////////////////////////////////////////
// RegisterEffect service
-static INT_PTR sttRegisterEffectWorker(EffectIDW *effect_id, int hLangpack)
+static INT_PTR sttRegisterEffectWorker(EffectIDW *effect_id, int _hLang)
{
if (effect_id->cbSize != sizeof(EffectIDW))
return -1;
@@ -440,7 +440,7 @@ static INT_PTR sttRegisterEffectWorker(EffectIDW *effect_id, int hLangpack)
EffectInternal* newItem = new EffectInternal;
memset(newItem, 0, sizeof(EffectInternal));
memcpy(newItem, effect_id, sizeof(EffectIDW));
- newItem->hLangpack = hLangpack;
+ newItem->hLangpack = _hLang;
UpdateEffectSettings(effect_id, &newItem->value);
effect_id_list.insert(newItem);
return 0;
@@ -493,9 +493,9 @@ INT_PTR GetEffect(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleEffects(int hLangpack)
+MIR_APP_DLL(void) KillModuleEffects(int _hLang)
{
for (int i = effect_id_list.getCount() - 1; i >= 0; i--)
- if (effect_id_list[i].hLangpack == hLangpack)
+ if (effect_id_list[i].hLangpack == _hLang)
effect_id_list.remove(i);
}
diff --git a/src/mir_app/src/sounds.cpp b/src/mir_app/src/sounds.cpp
index a8d230ce5c..c4623211bb 100644
--- a/src/mir_app/src/sounds.cpp
+++ b/src/mir_app/src/sounds.cpp
@@ -55,11 +55,11 @@ static OBJLIST<SoundItem> arSounds(10, CompareSounds);
///////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleSounds(int hLangpack)
+MIR_APP_DLL(void) KillModuleSounds(int _hLang)
{
for (int i = arSounds.getCount()-1; i >= 0; i--) {
- SoundItem& p = arSounds[i];
- if (p.hLangpack == hLangpack) {
+ SoundItem &p = arSounds[i];
+ if (p.hLangpack == _hLang) {
p.clear();
arSounds.remove(i);
}