summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/ownerinfo.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-10-12 14:18:20 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-10-12 14:18:20 +0000
commit0ecadfc45326fce5fc4ba28b27a0a7ad484e5b84 (patch)
treefef68e6433f39bd8d51e0718f0de8ea425e52be3 /protocols/Gadu-Gadu/src/ownerinfo.cpp
parentef1f6f8fac28594a151c4cd811d1590cfc7ff81d (diff)
Gadu-Gadu: folders restructurization
git-svn-id: http://svn.miranda-ng.org/main/trunk@1888 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Gadu-Gadu/src/ownerinfo.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/ownerinfo.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp
new file mode 100644
index 0000000000..6c37cdb180
--- /dev/null
+++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+// Gadu-Gadu Plugin for Miranda IM
+//
+// Copyright (c) 2003-2006 Adam Strzelecki <ono+miranda@java.pl>
+//
+// 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.
+////////////////////////////////////////////////////////////////////////////////
+
+#include "gg.h"
+
+//////////////////////////////////////////////////////////
+// remind password
+
+typedef struct
+{
+ uin_t uin;
+ const char *email;
+} GG_REMIND_PASS;
+
+void __cdecl GGPROTO::remindpasswordthread(void *param)
+{
+ // Connection handle
+ struct gg_http *h;
+ GG_REMIND_PASS *rp = (GG_REMIND_PASS *)param;
+ GGTOKEN token;
+
+#ifdef DEBUGMODE
+ netlog("gg_remindpasswordthread(): Starting.");
+#endif
+ if (!rp || !rp->email || !rp->uin || !strlen(rp->email))
+ {
+ if (rp) free(rp);
+ return;
+ }
+
+ // Get token
+ if (!gettoken(&token)) return;
+
+ if (!(h = gg_remind_passwd3(rp->uin, rp->email, token.id, token.val, 0)))
+ {
+ TCHAR error[128];
+ mir_sntprintf(error, SIZEOF(error), TranslateT("Password could not be reminded because of error:\n\t%s"), _tcserror(errno));
+ MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
+ netlog("gg_remindpasswordthread(): Password could not be reminded because of \"%s\".", strerror(errno));
+ }
+ else
+ {
+ gg_pubdir_free(h);
+ netlog("gg_remindpasswordthread(): Password remind successful.");
+ MessageBox(NULL, TranslateT("Password was sent to your e-mail."), m_tszUserName, MB_OK | MB_ICONINFORMATION);
+ }
+
+#ifdef DEBUGMODE
+ netlog("gg_remindpasswordthread(): End.");
+#endif
+ if (rp) free(rp);
+}
+
+void GGPROTO::remindpassword(uin_t uin, const char *email)
+{
+ GG_REMIND_PASS *rp = (GG_REMIND_PASS*)malloc(sizeof(GG_REMIND_PASS));
+
+ rp->uin = uin;
+ rp->email = email;
+ forkthread(&GGPROTO::remindpasswordthread, rp);
+}