summaryrefslogtreecommitdiff
path: root/protocols/Dummy
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Dummy')
-rw-r--r--protocols/Dummy/proto_dummy/res/Away.icobin5430 -> 0 bytes
-rw-r--r--protocols/Dummy/proto_dummy/res/DND.icobin5430 -> 0 bytes
-rw-r--r--protocols/Dummy/proto_dummy/res/FFC.icobin5430 -> 0 bytes
-rw-r--r--protocols/Dummy/proto_dummy/res/Invisible.icobin5430 -> 0 bytes
-rw-r--r--protocols/Dummy/proto_dummy/res/NA.icobin5430 -> 0 bytes
-rw-r--r--protocols/Dummy/proto_dummy/res/Occupied.icobin5430 -> 0 bytes
-rw-r--r--protocols/Dummy/proto_dummy/res/Online.icobin5430 -> 0 bytes
-rw-r--r--protocols/Dummy/proto_dummy/res/Proto_Dummy.rc8
-rw-r--r--protocols/Dummy/res/aim.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/res/icq.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/res/mra.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/res/msn.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/res/omegle.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/res/resource.rc29
-rw-r--r--protocols/Dummy/res/skype.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/res/tlen.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/res/xfire.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/res/yahoo.icobin0 -> 1150 bytes
-rw-r--r--protocols/Dummy/src/dummy.h4
-rw-r--r--protocols/Dummy/src/dummy_options.cpp7
-rw-r--r--protocols/Dummy/src/dummy_proto.cpp140
-rw-r--r--protocols/Dummy/src/dummy_proto.h5
-rw-r--r--protocols/Dummy/src/main.cpp25
-rw-r--r--protocols/Dummy/src/resource.h24
-rw-r--r--protocols/Dummy/src/stdafx.cxx2
-rw-r--r--protocols/Dummy/src/stdafx.h3
-rw-r--r--protocols/Dummy/src/version.h4
27 files changed, 164 insertions, 87 deletions
diff --git a/protocols/Dummy/proto_dummy/res/Away.ico b/protocols/Dummy/proto_dummy/res/Away.ico
deleted file mode 100644
index 4507fd3555..0000000000
--- a/protocols/Dummy/proto_dummy/res/Away.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/Dummy/proto_dummy/res/DND.ico b/protocols/Dummy/proto_dummy/res/DND.ico
deleted file mode 100644
index fa722577ad..0000000000
--- a/protocols/Dummy/proto_dummy/res/DND.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/Dummy/proto_dummy/res/FFC.ico b/protocols/Dummy/proto_dummy/res/FFC.ico
deleted file mode 100644
index f0d7976014..0000000000
--- a/protocols/Dummy/proto_dummy/res/FFC.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/Dummy/proto_dummy/res/Invisible.ico b/protocols/Dummy/proto_dummy/res/Invisible.ico
deleted file mode 100644
index 8874c61bf6..0000000000
--- a/protocols/Dummy/proto_dummy/res/Invisible.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/Dummy/proto_dummy/res/NA.ico b/protocols/Dummy/proto_dummy/res/NA.ico
deleted file mode 100644
index ba01420fb5..0000000000
--- a/protocols/Dummy/proto_dummy/res/NA.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/Dummy/proto_dummy/res/Occupied.ico b/protocols/Dummy/proto_dummy/res/Occupied.ico
deleted file mode 100644
index ba4662b516..0000000000
--- a/protocols/Dummy/proto_dummy/res/Occupied.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/Dummy/proto_dummy/res/Online.ico b/protocols/Dummy/proto_dummy/res/Online.ico
deleted file mode 100644
index 2a0e4ee302..0000000000
--- a/protocols/Dummy/proto_dummy/res/Online.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/Dummy/proto_dummy/res/Proto_Dummy.rc b/protocols/Dummy/proto_dummy/res/Proto_Dummy.rc
index 6ee7d50d4e..5f8f151dc4 100644
--- a/protocols/Dummy/proto_dummy/res/Proto_Dummy.rc
+++ b/protocols/Dummy/proto_dummy/res/Proto_Dummy.rc
@@ -52,13 +52,7 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "Offline.ico"
-IDI_ICON2 ICON "Online.ico"
-IDI_ICON3 ICON "Away.ico"
-IDI_ICON4 ICON "Invisible.ico"
-IDI_ICON5 ICON "NA.ico"
-IDI_ICON6 ICON "DND.ico"
-IDI_ICON7 ICON "Occupied.ico"
-IDI_ICON8 ICON "FFC.ico"
+
#endif // Russian (Russia) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Dummy/res/aim.ico b/protocols/Dummy/res/aim.ico
new file mode 100644
index 0000000000..93b13ab7a4
--- /dev/null
+++ b/protocols/Dummy/res/aim.ico
Binary files differ
diff --git a/protocols/Dummy/res/icq.ico b/protocols/Dummy/res/icq.ico
new file mode 100644
index 0000000000..e7abd2a10e
--- /dev/null
+++ b/protocols/Dummy/res/icq.ico
Binary files differ
diff --git a/protocols/Dummy/res/mra.ico b/protocols/Dummy/res/mra.ico
new file mode 100644
index 0000000000..ed716416e9
--- /dev/null
+++ b/protocols/Dummy/res/mra.ico
Binary files differ
diff --git a/protocols/Dummy/res/msn.ico b/protocols/Dummy/res/msn.ico
new file mode 100644
index 0000000000..fa5b98963c
--- /dev/null
+++ b/protocols/Dummy/res/msn.ico
Binary files differ
diff --git a/protocols/Dummy/res/omegle.ico b/protocols/Dummy/res/omegle.ico
new file mode 100644
index 0000000000..1e665ceac0
--- /dev/null
+++ b/protocols/Dummy/res/omegle.ico
Binary files differ
diff --git a/protocols/Dummy/res/resource.rc b/protocols/Dummy/res/resource.rc
index 7d7ef55679..1f962b9bb5 100644
--- a/protocols/Dummy/res/resource.rc
+++ b/protocols/Dummy/res/resource.rc
@@ -67,6 +67,35 @@ END
#endif // APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+IDI_AIM ICON "aim.ico"
+IDI_ICQ ICON "icq.ico"
+IDI_MRA ICON "mra.ico"
+IDI_MSN ICON "msn.ico"
+IDI_OMEGLE ICON "omegle.ico"
+IDI_SKYPE ICON "skype.ico"
+IDI_TLEN ICON "tlen.ico"
+IDI_XFIRE ICON "xfire.ico"
+IDI_YAHOO ICON "yahoo.ico"
+IDI_DUMMY ICON "..\\proto_dummy\\res\\Offline.ico"
+IDI_DISCORD ICON "..\\..\\Discord\\res\\discord.ico"
+IDI_EMLAN ICON "..\\..\\EmLanProto\\res\\icon_onl.ico"
+IDI_FACEBOOK ICON "..\\..\\Facebook\\res\\facebook.ico"
+IDI_GG ICON "..\\..\\Gadu-Gadu\\res\\gg.ico"
+IDI_IRC ICON "..\\..\\IRCG\\res\\irc.ico"
+IDI_JABBER ICON "..\\..\\JabberG\\res\\jabber.ico"
+IDI_MINECRAFT ICON "..\\..\\MinecraftDynmap\\res\\proto.ico"
+IDI_SAMETIME ICON "..\\..\\Sametime\\res\\online.ico"
+IDI_STEAM ICON "..\\..\\Steam\\res\\steam.ico"
+IDI_TELEGRAM ICON "..\\..\\Telegram\\res\\telegram.ico"
+IDI_TOX ICON "..\\..\\Tox\\res\\tox.ico"
+IDI_TWITTER ICON "..\\..\\Twitter\\res\\twitter.ico"
+IDI_VK ICON "..\\..\\VKontakte\\proto_vkontakte\\res\\Online.ico"
+IDI_WHATSAPP ICON "..\\..\\WhatsApp\\res\\whatsapp.ico"
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/protocols/Dummy/res/skype.ico b/protocols/Dummy/res/skype.ico
new file mode 100644
index 0000000000..26912f20f3
--- /dev/null
+++ b/protocols/Dummy/res/skype.ico
Binary files differ
diff --git a/protocols/Dummy/res/tlen.ico b/protocols/Dummy/res/tlen.ico
new file mode 100644
index 0000000000..0019bb2ae4
--- /dev/null
+++ b/protocols/Dummy/res/tlen.ico
Binary files differ
diff --git a/protocols/Dummy/res/xfire.ico b/protocols/Dummy/res/xfire.ico
new file mode 100644
index 0000000000..b93f1bef0c
--- /dev/null
+++ b/protocols/Dummy/res/xfire.ico
Binary files differ
diff --git a/protocols/Dummy/res/yahoo.ico b/protocols/Dummy/res/yahoo.ico
new file mode 100644
index 0000000000..739271d91d
--- /dev/null
+++ b/protocols/Dummy/res/yahoo.ico
Binary files differ
diff --git a/protocols/Dummy/src/dummy.h b/protocols/Dummy/src/dummy.h
index 2bffe7c45a..69d250ca03 100644
--- a/protocols/Dummy/src/dummy.h
+++ b/protocols/Dummy/src/dummy.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2014-17 Robert Pösel, 2017-24 Miranda NG team
+Copyright (c) 2014-17 Robert Pösel, 2017-25 Miranda NG team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -22,13 +22,13 @@ struct CDummyProto;
#define DUMMY_ID_TEMPLATE "Template"
#define DUMMY_ID_TEXT "UniqueIdText"
#define DUMMY_ID_SETTING "UniqueIdSetting"
-#define DUMMY_KEY_ALLOW_SENDING "AllowSending"
struct ttemplate
{
const char *name;
const char *setting;
const char *text;
+ int iconId;
};
extern const ttemplate templates[];
diff --git a/protocols/Dummy/src/dummy_options.cpp b/protocols/Dummy/src/dummy_options.cpp
index d1d7175905..205a74814d 100644
--- a/protocols/Dummy/src/dummy_options.cpp
+++ b/protocols/Dummy/src/dummy_options.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2014-17 Robert Pösel, 2017-24 Miranda NG team
+Copyright (c) 2014-17 Robert Pösel, 2017-25 Miranda NG team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -38,8 +38,7 @@ INT_PTR CALLBACK DummyAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
int templateId = ppro->getTemplateId();
SendDlgItemMessage(hwndDlg, IDC_TEMPLATE, CB_SETCURSEL, templateId, 0);
- boolean allowSending = ppro->getByte(DUMMY_KEY_ALLOW_SENDING, 0);
- CheckDlgButton(hwndDlg, IDC_ALLOW_SENDING, allowSending ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALLOW_SENDING, ppro->bAllowSending ? BST_CHECKED : BST_UNCHECKED);
ppro->selectTemplate(hwndDlg, templateId);
}
@@ -81,7 +80,7 @@ INT_PTR CALLBACK DummyAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
ppro->setString(DUMMY_ID_SETTING, str);
}
- ppro->setByte(DUMMY_KEY_ALLOW_SENDING, IsDlgButtonChecked(hwndDlg, IDC_ALLOW_SENDING));
+ ppro->bAllowSending = IsDlgButtonChecked(hwndDlg, IDC_ALLOW_SENDING);
}
break;
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp
index bd034acb54..5fe833d856 100644
--- a/protocols/Dummy/src/dummy_proto.cpp
+++ b/protocols/Dummy/src/dummy_proto.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2014-17 Robert Pösel, 2017-24 Miranda NG team
+Copyright (c) 2014-17 Robert Pösel, 2017-25 Miranda NG team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -19,33 +19,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
const ttemplate templates[] =
{
- { LPGEN("Custom"), "", "" },
- { "AIM", "SN", LPGEN("Screen name") },
- { "Discord", "id", LPGEN("Discord ID") },
- { "EmLAN", "Nick", LPGEN("User name") },
- { "Facebook", "ID", LPGEN("Facebook ID") },
- { "GG", "UIN", LPGEN("Gadu-Gadu number") },
- { "ICQ", "aimId", LPGEN("User ID") },
- { "ICQCorp", "UIN", LPGEN("ICQ number") },
- { "IRC", "Nick", LPGEN("Nickname") },
- { "Jabber", "jid", LPGEN("JID") },
- { "MinecraftDynmap", "Nick", LPGEN("Visible name") },
- { "MRA", "e-mail", LPGEN("E-mail address") },
- { "MSN", "wlid", LPGEN("Live ID") },
- { "Omegle", "nick", LPGEN("Visible name") },
- { "Sametime", "stid", LPGEN("ID") },
- { "Skype (SkypeKit)", "sid", LPGEN("Skype name") },
- { "Skype (Classic)", "Username", LPGEN("Skype name") },
- { "Skype (Web)", "Username", LPGEN("Skype name") },
- { "Steam", "SteamID", LPGEN("Steam ID") },
- { "Telegram", "id", LPGEN("Telegram ID") },
- { "Tlen", "jid", LPGEN("Tlen login") },
- { "Tox", "ToxID", LPGEN("Tox ID") },
- { "Twitter", "Username", LPGEN("Username") },
- { "VK", "ID", LPGEN("VKontakte ID") },
- { "WhatsApp", "ID", LPGEN("WhatsApp ID") },
- { "XFire", "Username", LPGEN("Username") },
- { "Yahoo", "yahoo_id", LPGEN("ID") },
+ { LPGEN("Custom"), "", "", IDI_DUMMY },
+ { "AIM", "SN", LPGEN("Screen name"), IDI_AIM },
+ { "Discord", "id", LPGEN("Discord ID"), IDI_DISCORD },
+ { "EmLAN", "Nick", LPGEN("User name"), IDI_EMLAN },
+ { "Facebook", "ID", LPGEN("Facebook ID"), IDI_FACEBOOK },
+ { "GG", "UIN", LPGEN("Gadu-Gadu number"), IDI_GG },
+ { "ICQ", "aimId", LPGEN("User ID"), IDI_ICQ },
+ { "ICQCorp", "UIN", LPGEN("ICQ number"), IDI_ICQ },
+ { "IRC", "Nick", LPGEN("Nickname"), IDI_IRC },
+ { "Jabber", "jid", LPGEN("JID"), IDI_JABBER },
+ { "MinecraftDynmap", "Nick", LPGEN("Visible name"), IDI_MINECRAFT },
+ { "MRA", "e-mail", LPGEN("E-mail address"), IDI_MRA },
+ { "MSN", "wlid", LPGEN("Live ID"), IDI_MSN },
+ { "Omegle", "nick", LPGEN("Visible name"), IDI_OMEGLE },
+ { "Sametime", "stid", LPGEN("ID"), IDI_SAMETIME },
+ { "Skype (SkypeKit)", "sid", LPGEN("Skype name"), IDI_SKYPE },
+ { "Skype (Classic)", "Username", LPGEN("Skype name"), IDI_SKYPE },
+ { "Skype (Web)", "Username", LPGEN("Skype name"), IDI_SKYPE },
+ { "Steam", "SteamID", LPGEN("Steam ID"), IDI_STEAM },
+ { "Telegram", "id", LPGEN("Telegram ID"), IDI_TELEGRAM },
+ { "Tlen", "jid", LPGEN("Tlen login"), IDI_TLEN },
+ { "Tox", "ToxID", LPGEN("Tox ID"), IDI_TOX },
+ { "Twitter", "Username", LPGEN("Username"), IDI_TWITTER },
+ { "VKontakte", "ID", LPGEN("VKontakte ID"), IDI_VK },
+ { "WhatsApp", "ID", LPGEN("WhatsApp ID"), IDI_WHATSAPP },
+ { "XFire", "Username", LPGEN("Username"), IDI_XFIRE },
+ { "Yahoo", "yahoo_id", LPGEN("ID"), IDI_YAHOO },
};
void FillTemplateCombo(HWND hwndDlg, int iCtrlId)
@@ -56,17 +56,21 @@ void FillTemplateCombo(HWND hwndDlg, int iCtrlId)
}
}
-void CDummyProto::SearchIdAckThread(void *targ)
+void InitIcons()
{
- PROTOSEARCHRESULT psr = { 0 };
- psr.cbSize = sizeof(psr);
- psr.flags = PSR_UNICODE;
- psr.id.w = (wchar_t*)targ;
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&psr);
-
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, targ, 0);
+ wchar_t wszDllName[MAX_PATH];
+ GetModuleFileNameW(g_plugin.getInst(), wszDllName, _countof(wszDllName));
- mir_free(targ);
+ SKINICONDESC sid = {};
+ sid.flags = SIDF_PATH_UNICODE;
+ sid.defaultFile.w = wszDllName;
+ sid.section.a = "Protocols/Dummy";
+ for (auto &it : templates) {
+ sid.iDefaultIndex = -it.iconId;
+ sid.pszName = (char *)it.name;
+ sid.description.a = (char *)it.name;
+ g_plugin.addIcon(&sid);
+ }
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -77,7 +81,8 @@ static int sttCompareProtocols(const CDummyProto *p1, const CDummyProto *p2)
}
CDummyProto::CDummyProto(const char *szModuleName, const wchar_t *ptszUserName) :
- PROTO<CDummyProto>(szModuleName, ptszUserName)
+ PROTO<CDummyProto>(szModuleName, ptszUserName),
+ bAllowSending(szModuleName, "AllowSending", false)
{
msgid = 0;
@@ -90,6 +95,7 @@ CDummyProto::CDummyProto(const char *szModuleName, const wchar_t *ptszUserName)
else uniqueIdText[0] = '\0';
uniqueIdSetting[0] = '\0';
+ m_hProtoIcon = g_plugin.getIconHandle(templates[id].iconId);
}
CDummyProto::~CDummyProto()
@@ -104,9 +110,12 @@ int CDummyProto::getTemplateId()
if (id >= 0 && id < _countof(templates))
return id;
- CMStringA szProto(getMStringA("AM_BaseProto"));
+ CMStringA szProto(getMStringA("AM_PrevProto"));
+ if (szProto.IsEmpty())
+ szProto = getMStringA("AM_BaseProto");
+
for (auto &it : templates)
- if (!stricmp(it.name, szProto))
+ if (szProto == it.name)
return int(&it - templates);
return 0;
@@ -131,23 +140,11 @@ INT_PTR CDummyProto::GetCaps(int type, MCONTACT)
{
switch(type) {
case PFLAGNUM_1:
- return PF1_IM | PF1_BASICSEARCH | PF1_ADDSEARCHRES;
-
- case PFLAGNUM_2:
- return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT;
-
- case PFLAGNUM_3:
- return 0;
+ return PF1_BASICSEARCH | PF1_ADDSEARCHRES | (bAllowSending ? PF1_IM : 0);
case PFLAGNUM_4:
return PF4_AVATARS | PF4_NOAUTHDENYREASON | PF4_NOCUSTOMAUTH;
- case PFLAGNUM_5:
- return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT;
-
- case PFLAG_MAXLENOFMESSAGE:
- return 0;
-
case PFLAG_UNIQUEIDTEXT:
if (uniqueIdSetting[0] == '\0') {
int id = getTemplateId();
@@ -163,6 +160,31 @@ INT_PTR CDummyProto::GetCaps(int type, MCONTACT)
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void CDummyProto::SearchIdAckThread(void *targ)
+{
+ PROTOSEARCHRESULT psr = { 0 };
+ psr.cbSize = sizeof(psr);
+ psr.flags = PSR_UNICODE;
+ psr.id.w = (wchar_t *)targ;
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, targ, (LPARAM)&psr);
+
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, targ, 0);
+
+ mir_free(targ);
+}
+
+HANDLE CDummyProto::SearchBasic(const wchar_t *id)
+{
+ if (uniqueIdSetting[0] == '\0')
+ return nullptr;
+
+ wchar_t *tid = mir_wstrdup(id);
+ ForkThread(&CDummyProto::SearchIdAckThread, tid);
+ return tid;
+}
+
//////////////////////////////////////////////////////////////////////////////
int CDummyProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg)
@@ -170,7 +192,7 @@ int CDummyProto::SendMsg(MCONTACT hContact, MEVENT, const char *msg)
std::string message = msg;
unsigned int id = InterlockedIncrement(&msgid);
- if (getByte(DUMMY_KEY_ALLOW_SENDING, 0))
+ if (bAllowSending)
ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id);
else
ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)id, (LPARAM)TranslateT("This Dummy account has disabled sending messages. Enable it in account options."));
@@ -182,15 +204,7 @@ int CDummyProto::SetStatus(int)
return 0;
}
-HANDLE CDummyProto::SearchBasic(const wchar_t* id)
-{
- if (uniqueIdSetting[0] == '\0')
- return nullptr;
-
- wchar_t *tid = mir_wstrdup(id);
- ForkThread(&CDummyProto::SearchIdAckThread, tid);
- return tid;
-}
+/////////////////////////////////////////////////////////////////////////////////////////
MCONTACT CDummyProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
diff --git a/protocols/Dummy/src/dummy_proto.h b/protocols/Dummy/src/dummy_proto.h
index b56795eedf..573d24cc0e 100644
--- a/protocols/Dummy/src/dummy_proto.h
+++ b/protocols/Dummy/src/dummy_proto.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2014-17 Robert Pösel, 2017-24 Miranda NG team
+Copyright (c) 2014-17 Robert Pösel, 2017-25 Miranda NG team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -38,7 +38,7 @@ struct CDummyProto : public PROTO<CDummyProto>
MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
- //==== Events ==========================================================================
+ //======================================================================================
MWindow OnCreateAccMgrUI(MWindow) override;
@@ -50,5 +50,6 @@ struct CDummyProto : public PROTO<CDummyProto>
int getTemplateId();
void selectTemplate(HWND, int templateId);
+ CMOption<bool> bAllowSending;
volatile unsigned int msgid;
};
diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp
index 1374ed9944..e0c7fb695a 100644
--- a/protocols/Dummy/src/main.cpp
+++ b/protocols/Dummy/src/main.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2014-17 Robert Pösel, 2017-24 Miranda NG team
+Copyright (c) 2014-17 Robert Pösel, 2017-25 Miranda NG team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -54,16 +54,22 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
static int OnDummyDoubleClicked(WPARAM hContact, LPARAM)
{
if (auto *pa = Proto_GetContactAccount(hContact))
- if (pa->ppro && pa->ppro->GetCaps(1000)) {
- CallService(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0);
- return 1;
- }
+ if (auto *ppro = (CDummyProto*)pa->ppro)
+ if (ppro->GetCaps(1000)) {
+ if (Contact::IsGroupChat(hContact) || !ppro->bAllowSending)
+ CallService(MS_HISTORY_SHOWCONTACTHISTORY, hContact, 0);
+ else
+ CallService(MS_MSG_SENDMESSAGE, hContact, 0);
+ return 1;
+ }
return 0;
}
int CMPlugin::Load()
{
+ InitIcons();
+
HookEvent(ME_CLIST_DOUBLECLICKED, OnDummyDoubleClicked);
return 0;
}
@@ -151,3 +157,12 @@ struct CMPluginMra : public ACCPROTOPLUGIN<CDummyProto>
}
}
static g_pluginMra;
+
+struct CMPluginSkype : public ACCPROTOPLUGIN<CDummyProto>
+{
+ CMPluginSkype() : ACCPROTOPLUGIN<CDummyProto>("SKYPE", pluginInfoEx)
+ {
+ SetUniqueId("SkypeId");
+ }
+}
+static g_pluginSkype;
diff --git a/protocols/Dummy/src/resource.h b/protocols/Dummy/src/resource.h
index f9405505ad..6f9537d8ba 100644
--- a/protocols/Dummy/src/resource.h
+++ b/protocols/Dummy/src/resource.h
@@ -3,6 +3,30 @@
// Used by D:\Development\Miranda\Miranda NG\protocols\Dummy\res\resource.rc
//
#define IDD_ACCMGRUI 101
+#define IDI_DUMMY 102
+#define IDI_AIM 103
+#define IDI_DISCORD 104
+#define IDI_EMLAN 105
+#define IDI_FACEBOOK 106
+#define IDI_GG 107
+#define IDI_ICQ 108
+#define IDI_IRC 109
+#define IDI_JABBER 110
+#define IDI_MINECRAFT 111
+#define IDI_MRA 112
+#define IDI_MSN 113
+#define IDI_OMEGLE 114
+#define IDI_SAMETIME 115
+#define IDI_SKYPE 116
+#define IDI_STEAM 117
+#define IDI_TELEGRAM 118
+#define IDI_TLEN 119
+#define IDI_TOX 120
+#define IDI_TWITTER 121
+#define IDI_VK 122
+#define IDI_WHATSAPP 123
+#define IDI_XFIRE 124
+#define IDI_YAHOO 125
#define IDC_ID_TEXT 1030
#define IDC_ID_SETTING 1031
#define IDC_TEMPLATE 1032
diff --git a/protocols/Dummy/src/stdafx.cxx b/protocols/Dummy/src/stdafx.cxx
index fa6f99ab47..c1ed8ae392 100644
--- a/protocols/Dummy/src/stdafx.cxx
+++ b/protocols/Dummy/src/stdafx.cxx
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2014-17 Robert Pösel, 2017-24 Miranda NG team
+Copyright (c) 2014-17 Robert Pösel, 2017-25 Miranda NG team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/protocols/Dummy/src/stdafx.h b/protocols/Dummy/src/stdafx.h
index 254731c90d..9ade7b5023 100644
--- a/protocols/Dummy/src/stdafx.h
+++ b/protocols/Dummy/src/stdafx.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2014-17 Robert Pösel, 2017-24 Miranda NG team
+Copyright (c) 2014-17 Robert Pösel, 2017-25 Miranda NG team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -62,3 +62,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dummy_proto.h"
void FillTemplateCombo(HWND hwndDlg, int iCtrlId);
+void InitIcons();
diff --git a/protocols/Dummy/src/version.h b/protocols/Dummy/src/version.h
index 4c247643bc..16ccdf16a6 100644
--- a/protocols/Dummy/src/version.h
+++ b/protocols/Dummy/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 2
#define __RELEASE_NUM 0
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
@@ -10,4 +10,4 @@
#define __DESCRIPTION "Dummy protocol for Miranda NG. Could be used for holding contacts and history from deprecated protocols or for creating virtual contacts."
#define __AUTHOR "Robert Pösel"
#define __AUTHORWEB "https://miranda-ng.org/p/Dummy"
-#define __COPYRIGHT "© 2014-17 Robert Pösel, 2017-24 Miranda NG team"
+#define __COPYRIGHT "© 2014-17 Robert Pösel, 2017-25 Miranda NG team"