From 1099f914b0eb16acdcbf594ac4105224a6dfb2fd Mon Sep 17 00:00:00 2001
From: Tobias Weimer <wishmaster51@googlemail.com>
Date: Wed, 17 Oct 2012 19:01:39 +0000
Subject: Merged with Miranda IM Jabber: - Patch to set gtalk android users as
 on the phone. - Can't use Jabber GSSAPI authentication on Windows 7.

git-svn-id: http://svn.miranda-ng.org/main/trunk@1971 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 protocols/JabberG/src/jabber_secur.cpp  |  8 +++++++-
 protocols/JabberG/src/jabber_thread.cpp | 21 ++++++++++++++-------
 2 files changed, 21 insertions(+), 8 deletions(-)

(limited to 'protocols/JabberG')

diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index c48ded22d6..e91496f774 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -66,8 +66,14 @@ TNtlmAuth::~TNtlmAuth()
 
 bool TNtlmAuth::getSpn( TCHAR* szSpn, size_t dwSpnLen )
 {
+	HMODULE hDll = GetModuleHandle(_T("secur32.dll"));
+	if (!hDll)
+		hDll = LoadLibrary(_T("secur32.dll"));
+	if (!hDll)
+		return false;
+
 	GetUserNameExType myGetUserNameEx = 
-		( GetUserNameExType )GetProcAddress( GetModuleHandleA( "secur32.dll" ), "GetUserNameExW" );
+		( GetUserNameExType )GetProcAddress(hDll, "GetUserNameExW" );
 
 	if ( !myGetUserNameEx ) return false;
 
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index d71fd2ab60..c8674bd943 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1663,13 +1663,20 @@ void CJabberProto::OnProcessPresence( HXML node, ThreadData* info )
 		}
 		DBCheckIsTransportedContact( from, hContact );
 		int status = ID_STATUS_ONLINE;
-		if (( showNode = xmlGetChild( node , "show" )) != NULL ) {
-			if (( show = xmlGetText( showNode )) != NULL ) {
-				if ( !_tcscmp( show, _T("away"))) status = ID_STATUS_AWAY;
-				else if ( !_tcscmp( show, _T("xa"))) status = ID_STATUS_NA;
-				else if ( !_tcscmp( show, _T("dnd"))) status = ID_STATUS_DND;
-				else if ( !_tcscmp( show, _T("chat"))) status = ID_STATUS_FREECHAT;
-		}	}
+        /* GTalk android user set status as on the phone */
+        if (_tcsstr(from, _T("android_talk")))
+                status = ID_STATUS_ONTHEPHONE;
+        else {
+            if (( showNode = xmlGetChild( node , "show" )) != NULL ) {
+                if (( show = xmlGetText( showNode ) ) != NULL ) {
+                    if ( !_tcscmp( show, _T("away"))) status = ID_STATUS_AWAY;
+                    else if ( !_tcscmp( show, _T("xa"))) status = ID_STATUS_NA;
+                    else if ( !_tcscmp( show, _T("dnd"))) status = ID_STATUS_DND;
+                    else if ( !_tcscmp( show, _T("chat"))) status = ID_STATUS_FREECHAT;
+                }
+            }      
+        }
+
 
 		char priority = 0;
 		if (( priorityNode = xmlGetChild( node , "priority" )) != NULL && xmlGetText( priorityNode ) != NULL )
-- 
cgit v1.2.3