summaryrefslogtreecommitdiff
path: root/protocols/Skype
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype')
-rw-r--r--protocols/Skype/src/skype.h1
-rw-r--r--protocols/Skype/src/skype_chat.cpp55
-rw-r--r--protocols/Skype/src/skype_proto.h1
-rw-r--r--protocols/Skype/src/skype_services.cpp3
4 files changed, 60 insertions, 0 deletions
diff --git a/protocols/Skype/src/skype.h b/protocols/Skype/src/skype.h
index 84aec32161..d27c7564ab 100644
--- a/protocols/Skype/src/skype.h
+++ b/protocols/Skype/src/skype.h
@@ -40,6 +40,7 @@
#include <m_xml.h>
#include <win2k.h>
#include <m_timezones.h>
+
#include <m_msg_buttonsbar.h>
#include <m_folders.h>
diff --git a/protocols/Skype/src/skype_chat.cpp b/protocols/Skype/src/skype_chat.cpp
index a16fdf0d73..cde19dac34 100644
--- a/protocols/Skype/src/skype_chat.cpp
+++ b/protocols/Skype/src/skype_chat.cpp
@@ -1720,3 +1720,58 @@ void CSkypeProto::OnConversationListChange(
void CSkypeProto::ChatRoomParseUriComands(const wchar_t *commands)
{
}
+
+static void appendString(bool bIsTipper, const TCHAR *tszTitle, const TCHAR *tszValue, TCHAR* buf, size_t bufSize)
+{
+ if (*buf) {
+ const TCHAR *szSeparator = (bIsTipper) ? _T("\n") : ((IsWinVerMEPlus()) ? _T("\r\n") : _T(" | "));
+ _tcsncat(buf, szSeparator, bufSize);
+ }
+
+ size_t len = _tcslen(buf);
+ buf += len;
+ bufSize -= len;
+
+ if (bIsTipper)
+ mir_sntprintf(buf, bufSize, _T("%s%s%s%s"), _T("<b>"), TranslateTS(tszTitle), _T("</b>\t"), tszValue);
+ else {
+ TCHAR* p = TranslateTS(tszTitle);
+ mir_sntprintf(buf, bufSize, _T("%s%s\t%s"), p, _tcslen(p)<=7 ? _T("\t") : _T(""), tszValue);
+ }
+}
+
+INT_PTR __cdecl CSkypeProto::SkypeGCGetToolTipText(WPARAM wParam, LPARAM lParam)
+{
+ if ( !wParam || !lParam)
+ return 0; //room global tooltip not supported yet
+
+ ChatRoom *room = this->FindChatRoom((TCHAR *)wParam);
+ if (room == NULL)
+ return 0; //no room found
+
+ ChatMember *member = room->FindChatMember((TCHAR *)lParam);
+ if (member == NULL)
+ return 0; //no contact found
+
+ // ok process info output will be:
+ // Skype name: sid
+ // Nick: Nickname
+ // Status: StatusText
+ // Role: Moderator
+
+ TCHAR outBuf[2048];
+ outBuf[0]=_T('\0');
+
+ bool bIsTipper = db_get_b(NULL, "Tab_SRMsg", "adv_TipperTooltip", 0) && ServiceExists("mToolTip/HideTip");
+
+ //sid
+ appendString(bIsTipper, _T("Skype name:"), member->GetSid(), outBuf, SIZEOF(outBuf));
+ //nick
+ appendString(bIsTipper, _T("Nick:"), member->GetNick(), outBuf, SIZEOF(outBuf));
+ //status
+ appendString(bIsTipper, _T("Status:"), (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)member->GetStatus(),GSMDF_TCHAR), outBuf, SIZEOF(outBuf));
+ //role
+ appendString(bIsTipper, _T("Role:"), ::TranslateW(ChatRoom::Roles[member->GetRank()]), outBuf, SIZEOF(outBuf));
+
+ return (INT_PTR)(outBuf[0] == 0 ? NULL : mir_tstrdup(outBuf));
+} \ No newline at end of file
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h
index e640686f31..8629f5b63f 100644
--- a/protocols/Skype/src/skype_proto.h
+++ b/protocols/Skype/src/skype_proto.h
@@ -327,6 +327,7 @@ protected:
// chat
void InitChatModule();
+ INT_PTR __cdecl SkypeGCGetToolTipText(WPARAM wParam, LPARAM lParam);
bool IsChatRoom(HANDLE hContact);
diff --git a/protocols/Skype/src/skype_services.cpp b/protocols/Skype/src/skype_services.cpp
index 5ab0deb67f..01e598727e 100644
--- a/protocols/Skype/src/skype_services.cpp
+++ b/protocols/Skype/src/skype_services.cpp
@@ -1,4 +1,5 @@
#include "skype.h"
+#include <m_chat.h>
void CSkypeProto::InitServiceList()
{
@@ -19,4 +20,6 @@ void CSkypeProto::InitInstanceServiceList()
this->CreateServiceObj(PS_GETAVATARCAPS, &CSkypeProto::GetAvatarCaps);
this->CreateServiceObj(PS_GETMYAVATART, &CSkypeProto::GetMyAvatar);
this->CreateServiceObj(PS_SETMYAVATART, &CSkypeProto::SetMyAvatar);
+ // service to get from protocol chat buddy info
+ this->CreateServiceObj(MS_GC_PROTO_GETTOOLTIPTEXT, &CSkypeProto::SkypeGCGetToolTipText);
}