summaryrefslogtreecommitdiff
path: root/lastseen-mod/userinfo.c
diff options
context:
space:
mode:
authorwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-17 12:37:21 +0000
committerwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-17 12:37:21 +0000
commit3c0233134bc5a8e42e3a621f0a5eef2aaf487474 (patch)
tree30e49d3065aa387392028a54ef3c1ee7294b9e1e /lastseen-mod/userinfo.c
parent9139772a56e38f15e08f1a4a3215cfd402f85dde (diff)
adding from berlios: dbx_tree, lastseen-mod, nudge, yamn
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@173 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'lastseen-mod/userinfo.c')
-rw-r--r--lastseen-mod/userinfo.c95
1 files changed, 95 insertions, 0 deletions
diff --git a/lastseen-mod/userinfo.c b/lastseen-mod/userinfo.c
new file mode 100644
index 0000000..eb1bf57
--- /dev/null
+++ b/lastseen-mod/userinfo.c
@@ -0,0 +1,95 @@
+/*
+"Last Seen mod" plugin for Miranda IM
+Copyright ( C ) 2002-03 micron-x
+Copyright ( C ) 2005-07 Y.B.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or ( at your option ) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+File name : $URL: http://svn.berlios.de/svnroot/repos/mgoodies/trunk/lastseen-mod/userinfo.c $
+Revision : $Rev: 1570 $
+Last change on : $Date: 2007-12-30 00:30:07 +0200 (Вс, 30 дек 2007) $
+Last change by : $Author: y_b $
+*/
+#include "seen.h"
+
+
+
+WNDPROC MainProc;
+
+
+
+extern HINSTANCE hInstance;
+extern DWORD dwmirver;
+
+
+
+BOOL CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
+{
+ switch(msg){
+ case WM_SETCURSOR:
+ SetCursor(LoadCursor(NULL,IDC_ARROW));
+ return 1;
+
+ default:
+ break;
+ }
+ return CallWindowProc(MainProc,hdlg,msg,wparam,lparam);
+}
+
+
+
+BOOL CALLBACK UserinfoDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
+{
+ char *szout;
+ DBVARIANT dbv;
+
+ switch(msg){
+
+ case WM_INITDIALOG:
+ MainProc=(WNDPROC)SetWindowLong(GetDlgItem(hdlg,IDC_INFOTEXT),GWL_WNDPROC,(LONG)EditProc);
+ szout=strdup(ParseString((!DBGetContactSetting(NULL,S_MOD,"UserStamp",&dbv)?dbv.pszVal:DEFAULT_USERSTAMP),(HANDLE)lparam,0));
+ SetDlgItemText(hdlg,IDC_INFOTEXT,szout);
+ if(!strcmp(szout,Translate("<unknown>")))
+ EnableWindow(GetDlgItem(hdlg,IDC_INFOTEXT),FALSE);
+ free(szout);
+ DBFreeVariant(&dbv);
+ break;
+
+ case WM_COMMAND:
+ if(HIWORD(wparam)==EN_SETFOCUS)
+ SetFocus(GetParent(hdlg));
+ break;
+ }
+
+ return 0;
+}
+
+
+
+int UserinfoInit(WPARAM wparam,LPARAM lparam)
+{
+ char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,lparam,0);
+ if (IsWatchedProtocol(proto)){
+ OPTIONSDIALOGPAGE uip;
+ ZeroMemory(&uip,sizeof(uip));
+ uip.cbSize=sizeof(uip);
+ uip.hInstance=hInstance;
+ uip.pszTemplate=MAKEINTRESOURCE(IDD_USERINFO);
+ uip.pszTitle=Translate("Last seen");
+ uip.pfnDlgProc=UserinfoDlgProc;
+ CallService(MS_USERINFO_ADDPAGE,wparam,(LPARAM)&uip);
+ }
+ return 0;
+}