M => +0 -0
M examples/config.json => examples/config.json +7 -7
@@ 1,9 1,9 @@
{
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36",
- "Authority": "kladjaklj.slack.com",
- "URL": "kladjaklj.slack.com",
- "Token": "xoxp-fake",
- "BCookie":"bcookie",
- "DCookie":"dcookie",
- "XCookie":"xcookie"
-}>
\ No newline at end of file
+ "Authority": "example.slack.com",
+ "URL": "example.slack.com",
+ "Token": "xoxp-xxxxxxxx-xxxxxxxx",
+ "BCookie":"b=",
+ "DCookie":"d=",
+ "XCookie":"x="
+}
M util.go => util.go +5 -2
@@ 107,12 107,15 @@ func ReadConfig(file string) (Smack, error) {
return Smack{}, err
}
// The cookie still needs to be set for d and b even if the variables are empty
- if smc.DCookie == "" {
+ if smc.DCookie == "" || sm.DCookie == "dcookie" {
smc.DCookie = "d="
}
- if smc.BCookie == "" {
+ if smc.BCookie == "" || sm.BCookie == "bcookie" {
smc.BCookie = "b="
}
+ if smc.XCookie == "" || sm.XCookie == "xcookie" {
+ smc.XCookie = "x="
+ }
sm := NewRequest(smc.URL, smc.Token)
sm.SetHeaders(map[string]string{
"Cookie": strings.Join([]string{smc.DCookie, smc.XCookie, smc.BCookie}, "; "),