diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-04 12:05:12 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-04 12:05:12 +0000 |
commit | 1b6b7ac88e07f1e7122d6f792927e077256c27da (patch) | |
tree | 8de94bb82fae3a73a291350e940277c0e11ae255 /protocols/Skype | |
parent | 173c419faeb1c726f84127627dc8860f7538f5cf (diff) |
added tooltip creation for group chats
git-svn-id: http://svn.miranda-ng.org/main/trunk@5231 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype')
-rw-r--r-- | protocols/Skype/src/skype.h | 1 | ||||
-rw-r--r-- | protocols/Skype/src/skype_chat.cpp | 55 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.h | 1 | ||||
-rw-r--r-- | protocols/Skype/src/skype_services.cpp | 3 |
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);
}
|