Transform incoming slack call URLs

See: https://github.com/dylex/slack-libpurple/issues/166
This commit is contained in:
Daniel Siepmann 2022-08-30 18:20:43 +02:00
parent 30b62d5196
commit 78137b34d9
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,22 @@
diff --git a/slack-message.c b/slack-message.c
index de49fa6..f870a04 100644
--- a/slack-message.c
+++ b/slack-message.c
@@ -164,6 +164,17 @@ void slack_message_to_html(GString *html, SlackAccount *sa, gchar *s, PurpleMess
}
s = r+1;
}
+
+ if (strstr(html->str, "slack.com/call") != NULL) {
+ char find[200] = "";
+ strcat(find, sa->host);
+ strcat(find, "/call");
+
+ char replace[60] = "app.slack.com/free-willy/";
+ strcat(replace, sa->team.id);
+
+ g_string_replace(html, find, replace, 0);
+ }
}
/*

View file

@ -11,6 +11,7 @@ self: super: {
patches = (old.patches or []) ++ [
./browser-based-auth.patch
./call-transformation.patch
];
});
}