summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r--protocols/SkypeWeb/src/requests/history.h14
-rw-r--r--protocols/SkypeWeb/src/skype_history_sync.cpp12
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h3
4 files changed, 26 insertions, 7 deletions
diff --git a/protocols/SkypeWeb/src/requests/history.h b/protocols/SkypeWeb/src/requests/history.h
index aede248d32..ecd3fbcb65 100644
--- a/protocols/SkypeWeb/src/requests/history.h
+++ b/protocols/SkypeWeb/src/requests/history.h
@@ -35,11 +35,9 @@ struct SyncHistoryFirstRequest : public AsyncHttpRequest
struct GetHistoryRequest : public AsyncHttpRequest
{
- GetHistoryRequest(const char *username, int pageSize, uint32_t timestamp, bool bOperative) :
- AsyncHttpRequest(REQUEST_GET, HOST_DEFAULT, 0, &CSkypeProto::OnGetServerHistory)
+ GetHistoryRequest(const char *who, int pageSize, uint32_t timestamp, bool bOperative) :
+ AsyncHttpRequest(REQUEST_GET, HOST_DEFAULT, "/users/ME/conversations/" + mir_urlEncode(who) + "/messages", &CSkypeProto::OnGetServerHistory)
{
- m_szUrl.AppendFormat("/users/ME/conversations/%s/messages", mir_urlEncode(username).c_str());
-
if (bOperative)
pUserInfo = this;
@@ -54,4 +52,12 @@ struct GetHistoryRequest : public AsyncHttpRequest
}
};
+struct EmptyHistoryRequest : public AsyncHttpRequest
+{
+ EmptyHistoryRequest(const char *who) :
+ AsyncHttpRequest(REQUEST_DELETE, HOST_DEFAULT, "/users/ME/conversations/" + mir_urlEncode(who) + "/messages")
+ {
+ }
+};
+
#endif //_SKYPE_REQUEST_HISTORY_H_
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp
index 44e8f5f23c..7c5092c0b3 100644
--- a/protocols/SkypeWeb/src/skype_history_sync.cpp
+++ b/protocols/SkypeWeb/src/skype_history_sync.cpp
@@ -134,7 +134,7 @@ void CSkypeProto::ReadHistoryRest(const char *szUrl)
PushRequest(new SyncHistoryFirstRequest(p+ g_plugin.szDefaultServer.GetLength()+3));
}
-INT_PTR CSkypeProto::GetContactHistory(WPARAM hContact, LPARAM)
+INT_PTR CSkypeProto::SvcLoadHistory(WPARAM hContact, LPARAM)
{
PushRequest(new GetHistoryRequest(getId(hContact), 100, 0, false));
return 0;
@@ -178,3 +178,13 @@ void CSkypeProto::OnSyncHistory(MHttpResponse *response, AsyncHttpRequest*)
m_bHistorySynced = true;
}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+
+INT_PTR CSkypeProto::SvcEmptyHistory(WPARAM hContact, LPARAM flags)
+{
+ if (flags & CDF_DEL_HISTORY) {
+ PushRequest(new EmptyHistoryRequest(getId(hContact)));
+ }
+ return 0;
+}
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index 5b1cf49f3e..df6ea85f2c 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -45,7 +45,9 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) :
CreateProtoService(PS_MENU_REQAUTH, &CSkypeProto::OnRequestAuth);
CreateProtoService(PS_MENU_GRANTAUTH, &CSkypeProto::OnGrantAuth);
- CreateProtoService(PS_MENU_LOADHISTORY, &CSkypeProto::GetContactHistory);
+
+ CreateProtoService(PS_MENU_LOADHISTORY, &CSkypeProto::SvcLoadHistory);
+ CreateProtoService(PS_EMPTY_SRV_HISTORY, &CSkypeProto::SvcEmptyHistory);
HookProtoEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index a5973d5c34..f6fa6faf31 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -339,7 +339,8 @@ private:
INT_PTR __cdecl UnblockContact(WPARAM hContact, LPARAM);
INT_PTR __cdecl OnRequestAuth(WPARAM hContact, LPARAM lParam);
INT_PTR __cdecl OnGrantAuth(WPARAM hContact, LPARAM);
- INT_PTR __cdecl GetContactHistory(WPARAM hContact, LPARAM lParam);
+ INT_PTR __cdecl SvcLoadHistory(WPARAM hContact, LPARAM lParam);
+ INT_PTR __cdecl SvcEmptyHistory(WPARAM hContact, LPARAM lParam);
INT_PTR __cdecl SvcCreateChat(WPARAM, LPARAM);
INT_PTR __cdecl ParseSkypeUriService(WPARAM, LPARAM lParam);