diff options
author | Eion Robb <eion@robbmob.com> | 2014-12-01 12:51:55 +0300 |
---|---|---|
committer | Eion Robb <eion@robbmob.com> | 2014-12-01 12:51:55 +0300 |
commit | cf09cbc7717364e74232c7f858c3670aaa44b6fb (patch) | |
tree | 271e7faec137c70c62152934ac82d1867e39b4a5 /skypeweb/skypeweb_util.c | |
parent | edeb6bcf8657f3ee4d3ddd027f958fc4c0d44d65 (diff) |
SkypeWeb : Handle threads (server-stored, multi-user chats)
Diffstat (limited to 'skypeweb/skypeweb_util.c')
-rw-r--r-- | skypeweb/skypeweb_util.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/skypeweb/skypeweb_util.c b/skypeweb/skypeweb_util.c index 3c53502..b635471 100644 --- a/skypeweb/skypeweb_util.c +++ b/skypeweb/skypeweb_util.c @@ -70,6 +70,28 @@ skypeweb_contact_url_to_name(const gchar *url) return start;
}
+/** turn https://bay-client-s.gateway.messenger.live.com/v1/users/ME/conversations/19:blah@thread.skype
+ into 19:blah@thread.skype
+*/
+const gchar *
+skypeweb_thread_url_to_name(const gchar *url)
+{
+ static gchar *tempname = NULL;
+ const gchar *start, *end;
+
+ start = g_strrstr(url, "/19:");
+ if (!start) return NULL;
+ start = start + 1;
+
+ if ((end = strchr(start, '/'))) {
+ g_free(tempname);
+ tempname = g_strndup(start, end - start);
+ return tempname;
+ }
+
+ return start;
+}
+
/** Blatantly stolen from MSN prpl, with super-secret SHA256 change! */
#define BUFSIZE 256
char *
@@ -168,3 +190,13 @@ skypeweb_hmac_sha256(char *input) return output;
}
+
+gint64
+skypeweb_get_js_time()
+{
+ GTimeVal val;
+
+ g_get_current_time (&val);
+
+ return (val.tv_sec * 1000) + (val.tv_usec / 1000);
+}
|