summaryrefslogtreecommitdiff
path: root/Protocols
diff options
context:
space:
mode:
Diffstat (limited to 'Protocols')
-rw-r--r--Protocols/IAX/Docs/iax_changelog.txt5
-rw-r--r--Protocols/IAX/Docs/iax_readme.txt1
-rw-r--r--Protocols/IAX/Docs/iax_version.txt2
-rw-r--r--Protocols/IAX/IAXProto.cpp27
-rw-r--r--Protocols/IAX/build/rakefile7
-rw-r--r--Protocols/IAX/commons.h1
-rw-r--r--Protocols/IAX/iax.cpp4
-rw-r--r--Protocols/IAX/iax.dsp48
-rw-r--r--Protocols/IAX/lib/iaxclient/Debug/libgsm.libbin139818 -> 139818 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Debug/libiax2.libbin285094 -> 285094 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Debug/libiaxclient.libbin2125760 -> 2125760 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Debug/libogg.libbin65558 -> 65558 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Debug/libportaudio.libbin396496 -> 396496 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Debug/libportmixer.libbin45542 -> 45542 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Debug/libspeex.libbin634058 -> 634058 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Release/libgsm.libbin49314 -> 46374 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Release/libiax2.libbin129474 -> 129474 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Release/libiaxclient.libbin822976 -> 867294 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Release/libogg.libbin29444 -> 29444 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Release/libportaudio.libbin141138 -> 141138 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Release/libportmixer.libbin15066 -> 15066 bytes
-rw-r--r--Protocols/IAX/lib/iaxclient/Release/libspeex.libbin294770 -> 294770 bytes
-rw-r--r--Protocols/IAX/popup.cpp328
-rw-r--r--Protocols/IAX/popup.h63
-rw-r--r--Protocols/IAX/res/IAX-away.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/IAX-dnd.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/IAX-freechat.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/IAX-invisible.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/IAX-na.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/IAX-occupied.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/IAX-offline.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/IAX-online.icobin0 -> 2038 bytes
-rw-r--r--Protocols/IAX/res/IAX-onthephone.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/IAX-outtolunch.icobin0 -> 1150 bytes
-rw-r--r--Protocols/IAX/res/proto_IAX.dllbin0 -> 16488 bytes
-rw-r--r--Protocols/IAX/resource.h16
-rw-r--r--Protocols/IAX/resource.rc1
37 files changed, 476 insertions, 27 deletions
diff --git a/Protocols/IAX/Docs/iax_changelog.txt b/Protocols/IAX/Docs/iax_changelog.txt
index 9cae522..39ca60b 100644
--- a/Protocols/IAX/Docs/iax_changelog.txt
+++ b/Protocols/IAX/Docs/iax_changelog.txt
@@ -2,6 +2,11 @@ IAX protocol
Changelog:
+. 0.1.3.0
+ + Added protocol icons
+ + Added popups
+ * Fix for connection after connection failed
+
. 0.1.2.0
* Fix for wrong voiceservice version
+ Added protocol icon (thanks Angeli-Ka)
diff --git a/Protocols/IAX/Docs/iax_readme.txt b/Protocols/IAX/Docs/iax_readme.txt
index e8987d7..4dd5a8c 100644
--- a/Protocols/IAX/Docs/iax_readme.txt
+++ b/Protocols/IAX/Docs/iax_readme.txt
@@ -14,7 +14,6 @@ WARNING: You can create only one instance of the protocol. If you create the sec
Todo:
- More than one instance
-- Protocol icons
- Use netlib to send/receive packages?
- Ask for new password at first login if "Save password" is not checked
diff --git a/Protocols/IAX/Docs/iax_version.txt b/Protocols/IAX/Docs/iax_version.txt
index 037b044..af5513a 100644
--- a/Protocols/IAX/Docs/iax_version.txt
+++ b/Protocols/IAX/Docs/iax_version.txt
@@ -1 +1 @@
-IAX protocol 0.1.2.0 \ No newline at end of file
+IAX protocol 0.1.3.0 \ No newline at end of file
diff --git a/Protocols/IAX/IAXProto.cpp b/Protocols/IAX/IAXProto.cpp
index e1d77bc..97cb972 100644
--- a/Protocols/IAX/IAXProto.cpp
+++ b/Protocols/IAX/IAXProto.cpp
@@ -31,7 +31,7 @@ IAXProto::IAXProto(const char *aProtoName, const TCHAR *aUserName)
{
InitializeCriticalSection(&cs);
- reg_id = 0;
+ reg_id = -1;
hNetlibUser = 0;
hCallStateEvent = 0;
m_iDesiredStatus = m_iStatus = ID_STATUS_OFFLINE;
@@ -179,10 +179,10 @@ INT_PTR __cdecl IAXProto::SetStatus( int iNewStatus )
mir_sntprintf(server_port, MAX_REGS(server_port), _T("%s:%d"), opts.host, opts.port);
reg_id = iaxc_register(TcharToUtf8(opts.username), opts.password, TcharToUtf8(server_port));
- if (reg_id <= 0)
+ if (reg_id < 0)
{
Error(_T("Error registering with IAX"));
- BroadcastStatus(ID_STATUS_OFFLINE);
+ Disconnect();
return -1;
}
}
@@ -308,6 +308,11 @@ void IAXProto::ShowMessage(int type, const TCHAR *fmt, va_list args)
mir_vsntprintf(&buff[7], MAX_REGS(buff)-7, fmt, args);
+ if (type == MESSAGE_TYPE_INFO)
+ ShowInfoPopup(&buff[7], m_tszUserName);
+ else if (type == MESSAGE_TYPE_ERROR)
+ ShowErrPopup(&buff[7], m_tszUserName);
+
// OutputDebugString(buff);
// OutputDebugString(_T("\n"));
CallService(MS_NETLIB_LOG, (WPARAM) hNetlibUser, (LPARAM) TcharToChar(buff).get());
@@ -318,14 +323,15 @@ void IAXProto::Disconnect()
{
Trace(_T("Disconnecting..."));
- iaxc_dump_all_calls();
-
- if (reg_id > 0)
+ if (reg_id >= 0)
{
+ iaxc_dump_all_calls();
+
iaxc_unregister(reg_id);
- reg_id = 0;
+ reg_id = -1;
}
+ m_iDesiredStatus = ID_STATUS_OFFLINE;
BroadcastStatus(ID_STATUS_OFFLINE);
}
@@ -462,6 +468,9 @@ int IAXProto::registration_callback(iaxc_ev_registration &reg)
{
BroadcastStatus(m_iDesiredStatus > ID_STATUS_OFFLINE ? m_iDesiredStatus : ID_STATUS_ONLINE);
+ if (reg.msgcount >= 65535)
+ reg.msgcount = -1;
+
int messages = max(0, reg.msgcount);
if (messages != voiceMessages)
@@ -600,7 +609,7 @@ INT_PTR __cdecl IAXProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam)
if (iaxc_start_processing_thread())
{
- Error(_T("Failed to initialize iax threads"));
+ Error(_T("Failed to initialize IAX threads"));
return 1;
}
@@ -652,7 +661,7 @@ void IAXProto::NotifyCall(int callNo, int state, HANDLE hContact, TCHAR *name, T
VOICE_CALL vc = {0};
vc.cbSize = sizeof(vc);
- vc.szModule = m_szModuleName;
+ vc.moduleName = m_szModuleName;
vc.id = itoa(callNo, tmp, 10);
vc.flags = VOICE_TCHAR;
vc.hContact = hContact;
diff --git a/Protocols/IAX/build/rakefile b/Protocols/IAX/build/rakefile
index b84fb6b..028b3d9 100644
--- a/Protocols/IAX/build/rakefile
+++ b/Protocols/IAX/build/rakefile
@@ -11,6 +11,7 @@ GC_NAME = "IAX"
SRC_DIR=File.expand_path("..")
DOCS_DIR=File.expand_path("../Docs")
+RES_DIR=File.expand_path("../res")
VERSION_FILE="#{DOCS_DIR}/#{PROJECT}_version.txt"
TYPES=[ 'ansi', 'unicode' ]
@@ -156,6 +157,12 @@ HISTORY_EVENTS=[ "../../../bin/Release/Plugins/aa_historyevents.dll", "../../../
cp_relative(file, DOCS_DIR, target_dir)
end
+ target_dir = File.join(ZIP_FOLDERS[i], 'Icons')
+ docs = FileList["#{RES_DIR}/proto_#{PROJECT}.dll"]
+ docs.each do |file|
+ cp_relative(file, RES_DIR, target_dir)
+ end
+
target_dir = File.join(ZIP_FOLDERS[i], 'Plugins')
makedirs target_dir
cp DLL[i], target_dir
diff --git a/Protocols/IAX/commons.h b/Protocols/IAX/commons.h
index 386ccf5..350ebea 100644
--- a/Protocols/IAX/commons.h
+++ b/Protocols/IAX/commons.h
@@ -70,6 +70,7 @@ Boston, MA 02111-1307, USA.
#include <iaxclient.h>
#include "resource.h"
+#include "popup.h"
#include "IAXProto.h"
diff --git a/Protocols/IAX/iax.cpp b/Protocols/IAX/iax.cpp
index c35fa14..20b8af4 100644
--- a/Protocols/IAX/iax.cpp
+++ b/Protocols/IAX/iax.cpp
@@ -30,11 +30,11 @@ PLUGININFOEX pluginInfo={
#else
"IAX protocol (Ansi)",
#endif
- PLUGIN_MAKE_VERSION(0,1,2,0),
+ PLUGIN_MAKE_VERSION(0,1,3,0),
"Provides support for Inter-Asterisk eXchange (IAX) protocol",
"Ricardo Pescuma Domenecci",
"pescuma@miranda-im.org",
- "© 2009 Ricardo Pescuma Domenecci",
+ "© 2009-2010 Ricardo Pescuma Domenecci",
"http://pescuma.org/miranda/iax",
UNICODE_AWARE,
0, //doesn't replace anything built-in
diff --git a/Protocols/IAX/iax.dsp b/Protocols/IAX/iax.dsp
index 985722c..84257b4 100644
--- a/Protocols/IAX/iax.dsp
+++ b/Protocols/IAX/iax.dsp
@@ -184,6 +184,10 @@ SOURCE=..\..\plugins\utils\mir_options.h
# End Source File
# Begin Source File
+SOURCE=.\popup.h
+# End Source File
+# Begin Source File
+
SOURCE=.\resource.h
# End Source File
# End Group
@@ -192,6 +196,46 @@ SOURCE=.\resource.h
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
+SOURCE=".\res\IAX-away.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-dnd.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-freechat.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-invisible.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-na.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-occupied.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-offline.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-online.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-onthephone.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\IAX-outtolunch.ico"
+# End Source File
+# Begin Source File
+
SOURCE=.\res\Logo.ico
# End Source File
# Begin Source File
@@ -222,6 +266,10 @@ SOURCE=..\..\plugins\utils\mir_log.cpp
SOURCE=..\..\plugins\utils\mir_options.cpp
# End Source File
+# Begin Source File
+
+SOURCE=.\popup.cpp
+# End Source File
# End Group
# Begin Group "Docs"
diff --git a/Protocols/IAX/lib/iaxclient/Debug/libgsm.lib b/Protocols/IAX/lib/iaxclient/Debug/libgsm.lib
index 4858153..4807636 100644
--- a/Protocols/IAX/lib/iaxclient/Debug/libgsm.lib
+++ b/Protocols/IAX/lib/iaxclient/Debug/libgsm.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Debug/libiax2.lib b/Protocols/IAX/lib/iaxclient/Debug/libiax2.lib
index 1655522..e65a5bc 100644
--- a/Protocols/IAX/lib/iaxclient/Debug/libiax2.lib
+++ b/Protocols/IAX/lib/iaxclient/Debug/libiax2.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Debug/libiaxclient.lib b/Protocols/IAX/lib/iaxclient/Debug/libiaxclient.lib
index 17acc0d..693db52 100644
--- a/Protocols/IAX/lib/iaxclient/Debug/libiaxclient.lib
+++ b/Protocols/IAX/lib/iaxclient/Debug/libiaxclient.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Debug/libogg.lib b/Protocols/IAX/lib/iaxclient/Debug/libogg.lib
index 423dc18..595e06e 100644
--- a/Protocols/IAX/lib/iaxclient/Debug/libogg.lib
+++ b/Protocols/IAX/lib/iaxclient/Debug/libogg.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Debug/libportaudio.lib b/Protocols/IAX/lib/iaxclient/Debug/libportaudio.lib
index 461b78d..25092f3 100644
--- a/Protocols/IAX/lib/iaxclient/Debug/libportaudio.lib
+++ b/Protocols/IAX/lib/iaxclient/Debug/libportaudio.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Debug/libportmixer.lib b/Protocols/IAX/lib/iaxclient/Debug/libportmixer.lib
index c87b834..14f9db5 100644
--- a/Protocols/IAX/lib/iaxclient/Debug/libportmixer.lib
+++ b/Protocols/IAX/lib/iaxclient/Debug/libportmixer.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Debug/libspeex.lib b/Protocols/IAX/lib/iaxclient/Debug/libspeex.lib
index 7a6c550..c22a5a0 100644
--- a/Protocols/IAX/lib/iaxclient/Debug/libspeex.lib
+++ b/Protocols/IAX/lib/iaxclient/Debug/libspeex.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Release/libgsm.lib b/Protocols/IAX/lib/iaxclient/Release/libgsm.lib
index 4ab2c65..f6fcb44 100644
--- a/Protocols/IAX/lib/iaxclient/Release/libgsm.lib
+++ b/Protocols/IAX/lib/iaxclient/Release/libgsm.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Release/libiax2.lib b/Protocols/IAX/lib/iaxclient/Release/libiax2.lib
index 0356030..c451e14 100644
--- a/Protocols/IAX/lib/iaxclient/Release/libiax2.lib
+++ b/Protocols/IAX/lib/iaxclient/Release/libiax2.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Release/libiaxclient.lib b/Protocols/IAX/lib/iaxclient/Release/libiaxclient.lib
index 23db9e8..92e2327 100644
--- a/Protocols/IAX/lib/iaxclient/Release/libiaxclient.lib
+++ b/Protocols/IAX/lib/iaxclient/Release/libiaxclient.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Release/libogg.lib b/Protocols/IAX/lib/iaxclient/Release/libogg.lib
index 7300e9d..f1dd414 100644
--- a/Protocols/IAX/lib/iaxclient/Release/libogg.lib
+++ b/Protocols/IAX/lib/iaxclient/Release/libogg.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Release/libportaudio.lib b/Protocols/IAX/lib/iaxclient/Release/libportaudio.lib
index 88ccf54..198ca53 100644
--- a/Protocols/IAX/lib/iaxclient/Release/libportaudio.lib
+++ b/Protocols/IAX/lib/iaxclient/Release/libportaudio.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Release/libportmixer.lib b/Protocols/IAX/lib/iaxclient/Release/libportmixer.lib
index 7eb0f64..f800379 100644
--- a/Protocols/IAX/lib/iaxclient/Release/libportmixer.lib
+++ b/Protocols/IAX/lib/iaxclient/Release/libportmixer.lib
Binary files differ
diff --git a/Protocols/IAX/lib/iaxclient/Release/libspeex.lib b/Protocols/IAX/lib/iaxclient/Release/libspeex.lib
index ae6362d..537f047 100644
--- a/Protocols/IAX/lib/iaxclient/Release/libspeex.lib
+++ b/Protocols/IAX/lib/iaxclient/Release/libspeex.lib
Binary files differ
diff --git a/Protocols/IAX/popup.cpp b/Protocols/IAX/popup.cpp
new file mode 100644
index 0000000..0d2d71c
--- /dev/null
+++ b/Protocols/IAX/popup.cpp
@@ -0,0 +1,328 @@
+/*
+Copyright (C) 2005-2010 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#include "commons.h"
+
+
+
+// Prototypes /////////////////////////////////////////////////////////////////////////////////////
+
+#define WMU_ACTION (WM_USER + 1)
+
+
+LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+HWND hPopupWindow = NULL;
+
+
+static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
+static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
+
+
+
+// Functions //////////////////////////////////////////////////////////////////////////////////////
+
+
+// Initializations needed by popups
+void InitPopups()
+{
+ // window needed for popup commands
+ hPopupWindow = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), _T(MODULE_NAME) _T("_PopupWindow"),
+ 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP,
+ NULL, hInst, NULL);
+ SetWindowLong(hPopupWindow, GWL_WNDPROC, (LONG)(WNDPROC)PopupWndProc);
+}
+
+
+// Deinitializations needed by popups
+void DeInitPopups()
+{
+}
+
+
+void ShowErrPopup(const TCHAR *description, const TCHAR *title)
+{
+ ShowPopupEx(NULL, title == NULL ? _T(MODULE_NAME) _T(" Error") : title, description,
+ NULL, POPUP_TYPE_ERROR, NULL);
+}
+
+
+void ShowInfoPopup(const TCHAR *description, const TCHAR *title)
+{
+ ShowPopupEx(NULL, title == NULL ? _T(MODULE_NAME) _T(" Information") : title, description,
+ NULL, POPUP_TYPE_INFO, NULL);
+}
+
+
+void ShowTestPopup(const TCHAR *title, const TCHAR *description, const Options *op)
+{
+ ShowPopupEx(NULL, title, description, NULL, POPUP_TYPE_TEST, op);
+}
+
+
+void ShowPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description)
+{
+ ShowPopupEx(hContact, title, description, hContact, POPUP_TYPE_NORMAL, NULL);
+}
+
+
+// Show an popup
+void ShowPopupEx(HANDLE hContact, const TCHAR *title, const TCHAR *description,
+ void *plugin_data, int type, const Options *op)
+{
+#ifdef UNICODE
+ if(ServiceExists(MS_POPUP_ADDPOPUPW))
+ {
+ // Make popup
+ POPUPDATAW ppd;
+
+ ZeroMemory(&ppd, sizeof(ppd));
+ ppd.lchContact = hContact;
+ ppd.lchIcon = (HICON) LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(174),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
+
+ if (title != NULL)
+ lstrcpyn(ppd.lpwzContactName, title, MAX_REGS(ppd.lpwzContactName));
+ else if (hContact != NULL)
+ lstrcpyn(ppd.lpwzContactName, (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR),
+ MAX_REGS(ppd.lpwzContactName));
+
+ if (description != NULL)
+ lstrcpyn(ppd.lpwzText, description, MAX_REGS(ppd.lpwzText));
+
+ if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
+ {
+/* if (op->popup_use_default_colors)
+ {
+ ppd.colorBack = 0;
+ ppd.colorText = 0;
+ }
+ else if (op->popup_use_win_colors)
+ {
+ ppd.colorBack = GetSysColor(COLOR_BTNFACE);
+ ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
+ }
+ else
+ {
+ ppd.colorBack = op->popup_bkg_color;
+ ppd.colorText = op->popup_text_color;
+ }
+*/ }
+ else if (type == POPUP_TYPE_ERROR)
+ {
+ ppd.colorBack = RGB(200,0,0);
+ ppd.colorText = RGB(255,255,255);
+ }
+ else // if (type == POPUP_TYPE_INFO)
+ {
+ ppd.colorBack = RGB(255,255,128);
+ ppd.colorText = RGB(0,0,0);
+ }
+
+ if (type == POPUP_TYPE_NORMAL)
+ {
+ ppd.PluginWindowProc = PopupDlgProc;
+ ppd.PluginData = plugin_data;
+ }
+ else // if (type == POPUP_TYPE_TEST || type == POPUP_TYPE_ERROR)
+ {
+ ppd.PluginWindowProc = DumbPopupDlgProc;
+ }
+
+ if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
+ {
+/* switch (op->popup_delay_type)
+ {
+ case POPUP_DELAY_CUSTOM:
+ ppd.iSeconds = opts.popup_timeout;
+ break;
+
+ case POPUP_DELAY_PERMANENT:
+ ppd.iSeconds = -1;
+ break;
+
+ //case POPUP_DELAY_DEFAULT:
+ default:
+ ppd.iSeconds = 0;
+ break;
+ }
+*/ }
+ else // if (type == POPUP_TYPE_ERROR || type == POPUP_TYPE_INFO)
+ {
+ ppd.iSeconds = 0;
+ }
+
+ // Now that every field has been filled, we want to see the popup.
+ CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&ppd,0);
+ }
+ else
+#endif
+ if(ServiceExists(MS_POPUP_ADDPOPUPEX))
+ {
+ // Make popup
+ POPUPDATAEX ppd;
+
+ ZeroMemory(&ppd, sizeof(ppd));
+ ppd.lchContact = hContact;
+ ppd.lchIcon = (HICON) LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(174),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
+
+ if (title != NULL)
+ lstrcpynA(ppd.lpzContactName, TcharToChar(title), MAX_REGS(ppd.lpzContactName));
+ else
+ lstrcpynA(ppd.lpzContactName, (char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0),
+ MAX_REGS(ppd.lpzContactName));
+
+ if (description != NULL)
+ lstrcpynA(ppd.lpzText, TcharToChar(description), MAX_REGS(ppd.lpzText));
+
+ if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
+ {
+/* if (op->popup_use_default_colors)
+ {
+ ppd.colorBack = 0;
+ ppd.colorText = 0;
+ }
+ else if (op->popup_use_win_colors)
+ {
+ ppd.colorBack = GetSysColor(COLOR_BTNFACE);
+ ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
+ }
+ else
+ {
+ ppd.colorBack = op->popup_bkg_color;
+ ppd.colorText = op->popup_text_color;
+ }
+*/
+ }
+ else if (type == POPUP_TYPE_ERROR)
+ {
+ ppd.colorBack = RGB(200,0,0);
+ ppd.colorText = RGB(255,255,255);
+ }
+ else // if (type == POPUP_TYPE_INFO)
+ {
+ ppd.colorBack = RGB(255,255,128);
+ ppd.colorText = RGB(0,0,0);
+ }
+
+ if (type == POPUP_TYPE_NORMAL)
+ {
+ ppd.PluginWindowProc = PopupDlgProc;
+ ppd.PluginData = plugin_data;
+ }
+ else // if (type == POPUP_TYPE_TEST || type == POPUP_TYPE_ERROR)
+ {
+ ppd.PluginWindowProc = DumbPopupDlgProc;
+ }
+
+ if (type == POPUP_TYPE_NORMAL || type == POPUP_TYPE_TEST)
+ {
+/* switch (op->popup_delay_type)
+ {
+ case POPUP_DELAY_CUSTOM:
+ ppd.iSeconds = opts.popup_timeout;
+ break;
+
+ case POPUP_DELAY_PERMANENT:
+ ppd.iSeconds = -1;
+ break;
+
+ //case POPUP_DELAY_DEFAULT:
+ default:
+ ppd.iSeconds = 0;
+ break;
+ }
+*/ }
+ else // if (type == POPUP_TYPE_ERROR || type == POPUP_TYPE_INFO)
+ {
+ ppd.iSeconds = 0;
+ }
+
+ // Now that every field has been filled, we want to see the popup.
+ CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd,0);
+ }
+}
+
+
+// Handle to the hidden windows to handle actions for popup clicks
+// wParam has the number of MOTD in case of WMU_SHOW_MOTD_DETAILS
+LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ if (uMsg == WMU_ACTION)
+ {
+ }
+ return DefWindowProc(hWnd, uMsg, wParam, lParam);
+}
+
+
+// Handle to popup events
+static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch(message) {
+ case WM_COMMAND:
+ {
+ SendMessage(hPopupWindow, WMU_ACTION, (WPARAM)PUGetPluginData(hWnd), 0);
+ PUDeletePopUp(hWnd);
+
+ return TRUE;
+ }
+
+ case WM_CONTEXTMENU:
+ {
+ SendMessage(hPopupWindow, WMU_ACTION, (WPARAM)PUGetPluginData(hWnd), 0);
+ PUDeletePopUp(hWnd);
+
+ return TRUE;
+ }
+
+ case UM_FREEPLUGINDATA:
+ {
+ return TRUE;
+ }
+ }
+
+ return DefWindowProc(hWnd, message, wParam, lParam);
+}
+
+
+// Handle to popup events
+static LRESULT CALLBACK DumbPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch(message) {
+ case WM_COMMAND:
+ {
+ PUDeletePopUp(hWnd);
+ return TRUE;
+ }
+
+ case WM_CONTEXTMENU:
+ {
+ PUDeletePopUp(hWnd);
+ return TRUE;
+ }
+
+ case UM_FREEPLUGINDATA:
+ {
+ return TRUE;
+ }
+ }
+
+ return DefWindowProc(hWnd, message, wParam, lParam);
+}
+
diff --git a/Protocols/IAX/popup.h b/Protocols/IAX/popup.h
new file mode 100644
index 0000000..0ed6db2
--- /dev/null
+++ b/Protocols/IAX/popup.h
@@ -0,0 +1,63 @@
+/*
+Copyright (C) 2005-2010 Ricardo Pescuma Domenecci
+
+This is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this file; see the file license.txt. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __POPUP_H__
+# define __POPUP_H__
+
+#include "commons.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef void * Options;
+
+
+// Initializations needed by popups
+void InitPopups();
+
+// Deinitializations needed by popups
+void DeInitPopups();
+
+
+#define POPUP_TYPE_NORMAL 0
+#define POPUP_TYPE_TEST 1
+#define POPUP_TYPE_ERROR 2
+#define POPUP_TYPE_INFO 3
+
+void ShowPopup(HANDLE hContact, const TCHAR *title, const TCHAR *description);
+
+void ShowTestPopup(const TCHAR *title, const TCHAR *description, const Options *op);
+
+void ShowErrPopup(const TCHAR *description, const TCHAR *title = NULL);
+
+void ShowInfoPopup(const TCHAR *description, const TCHAR *title = NULL);
+
+void ShowPopupEx(HANDLE hContact, const TCHAR *title, const TCHAR *description,
+ void *plugin_data, int type, const Options *op);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // __POPUP_H__
diff --git a/Protocols/IAX/res/IAX-away.ico b/Protocols/IAX/res/IAX-away.ico
new file mode 100644
index 0000000..1ce5071
--- /dev/null
+++ b/Protocols/IAX/res/IAX-away.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-dnd.ico b/Protocols/IAX/res/IAX-dnd.ico
new file mode 100644
index 0000000..549e7f8
--- /dev/null
+++ b/Protocols/IAX/res/IAX-dnd.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-freechat.ico b/Protocols/IAX/res/IAX-freechat.ico
new file mode 100644
index 0000000..666d252
--- /dev/null
+++ b/Protocols/IAX/res/IAX-freechat.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-invisible.ico b/Protocols/IAX/res/IAX-invisible.ico
new file mode 100644
index 0000000..58eb675
--- /dev/null
+++ b/Protocols/IAX/res/IAX-invisible.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-na.ico b/Protocols/IAX/res/IAX-na.ico
new file mode 100644
index 0000000..d05d5ed
--- /dev/null
+++ b/Protocols/IAX/res/IAX-na.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-occupied.ico b/Protocols/IAX/res/IAX-occupied.ico
new file mode 100644
index 0000000..8e71e2c
--- /dev/null
+++ b/Protocols/IAX/res/IAX-occupied.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-offline.ico b/Protocols/IAX/res/IAX-offline.ico
new file mode 100644
index 0000000..95aef36
--- /dev/null
+++ b/Protocols/IAX/res/IAX-offline.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-online.ico b/Protocols/IAX/res/IAX-online.ico
new file mode 100644
index 0000000..60cc977
--- /dev/null
+++ b/Protocols/IAX/res/IAX-online.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-onthephone.ico b/Protocols/IAX/res/IAX-onthephone.ico
new file mode 100644
index 0000000..51be5e7
--- /dev/null
+++ b/Protocols/IAX/res/IAX-onthephone.ico
Binary files differ
diff --git a/Protocols/IAX/res/IAX-outtolunch.ico b/Protocols/IAX/res/IAX-outtolunch.ico
new file mode 100644
index 0000000..580d084
--- /dev/null
+++ b/Protocols/IAX/res/IAX-outtolunch.ico
Binary files differ
diff --git a/Protocols/IAX/res/proto_IAX.dll b/Protocols/IAX/res/proto_IAX.dll
new file mode 100644
index 0000000..91d5833
--- /dev/null
+++ b/Protocols/IAX/res/proto_IAX.dll
Binary files differ
diff --git a/Protocols/IAX/resource.h b/Protocols/IAX/resource.h
index 20143d6..83420fa 100644
--- a/Protocols/IAX/resource.h
+++ b/Protocols/IAX/resource.h
@@ -4,8 +4,7 @@
//
#define IDD_OPTIONS 119
#define IDD_OPTIONS_OLD 120
-#define IDD_EMOTICON_SELECTION 126
-#define IDI_PROTO 128
+#define IDI_PROTO 160
#define IDD_ACCMGRUI 227
#define IDC_USERNAME 1000
#define IDC_PASSWORD 1001
@@ -14,17 +13,6 @@
#define IDC_PORT 1004
#define IDC_HOST 1043
#define IDC_SAVEPASSWORD 1048
-#define IDC_INPUT_TOO 1060
-#define IDC_IGNORE_UPPERCASE 1065
-#define IDC_AUTO_USER 1066
-#define IDC_USE_DEFAULT_PACK 1066
-#define IDC_PACK 1075
-#define IDC_GETMORE 1076
-#define IDC_EMOTICONS 1080
-#define IDC_ONLY_ISOLATED 1086
-#define IDC_ONLY_ISOLATED2 1087
-#define IDC_CUSTOM_SMILEYS 1087
-#define IDC_VIDEO 1088
#define IDC_STATIC -1
// Next default values for new objects
@@ -33,7 +21,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 129
+#define _APS_NEXT_RESOURCE_VALUE 161
#define _APS_NEXT_COMMAND_VALUE 40005
#define _APS_NEXT_CONTROL_VALUE 1087
#define _APS_NEXT_SYMED_VALUE 101
diff --git a/Protocols/IAX/resource.rc b/Protocols/IAX/resource.rc
index e1e30f2..d6094d3 100644
--- a/Protocols/IAX/resource.rc
+++ b/Protocols/IAX/resource.rc
@@ -94,6 +94,7 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_PROTO ICON DISCARDABLE "res\\Logo.ico"
+
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////