From 7b7fc6d1666ea737e4e6d47baa9c5b05f5e05730 Mon Sep 17 00:00:00 2001 From: Eion Robb Date: Wed, 26 Oct 2016 21:39:44 +1300 Subject: Blindly try to make Skype for Business connections work by prefixing buddies with a 2: --- skypeweb/libskypeweb.h | 1 + skypeweb/skypeweb_util.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/skypeweb/libskypeweb.h b/skypeweb/libskypeweb.h index 00ca914..52de55e 100644 --- a/skypeweb/libskypeweb.h +++ b/skypeweb/libskypeweb.h @@ -270,6 +270,7 @@ G_MODULE_EXPORT GType skypeweb_protocol_get_type(void); #define SKYPEWEB_BUDDY_IS_MSN(a) G_UNLIKELY((a) != NULL && strchr((a), '@') != NULL) #define SKYPEWEB_BUDDY_IS_PHONE(a) G_UNLIKELY((a) != NULL && *(a) == '+') +#define SKYPEWEB_BUDDY_IS_S4B(a) G_UNLIKELY((a) != NULL && g_str_has_prefix((a), "2:")) typedef struct _SkypeWebAccount SkypeWebAccount; typedef struct _SkypeWebBuddy SkypeWebBuddy; diff --git a/skypeweb/skypeweb_util.c b/skypeweb/skypeweb_util.c index d67b937..c4c16fa 100644 --- a/skypeweb/skypeweb_util.c +++ b/skypeweb/skypeweb_util.c @@ -82,8 +82,10 @@ skypeweb_contact_url_to_name(const gchar *url) start = g_strrstr(url, "/8:"); if (!start) start = g_strrstr(url, "/1:"); if (!start) start = g_strrstr(url, "/4:"); + if (start) start = start + 2; + if (!start) start = g_strrstr(url, "/2:"); + if (start) start = start + 1; if (!start) return NULL; - start = start + 3; if ((end = strchr(start, '/'))) { g_free(tempname); @@ -394,6 +396,8 @@ skypeweb_user_url_prefix(const gchar *who) { if (SKYPEWEB_BUDDY_IS_MSN(who)) { return "1:"; + } else if(SKYPEWEB_BUDDY_IS_S4B(who)) { + return ""; // already has the 2: prefix! } else if(SKYPEWEB_BUDDY_IS_PHONE(who)) { return "4:"; } else { -- cgit v1.2.3