File tree 1 file changed +2
-1
lines changed 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 2
2
(:require [org.httpkit.server :refer [with-channel on-close on-receive send!]]
3
3
[chatb0x.user :refer :all ]
4
4
[cheshire.core :refer [generate-string]]
5
+ [cemerick.friend :as friend]
5
6
[digest :refer [md5]]
6
7
[clojure.string :as str]))
7
8
114
115
(with-channel req channel
115
116
; ; CONNECT
116
117
(println req)
117
- (if (contains? ( get-in req [ :session :cemerick. friend/identity :authentications nil :roles ]) : chatb0x.user/agent )
118
+ (if (friend/authorized? #{ : chatb0x.user/agent} ( friend/identity req) )
118
119
(do (println " Agent connected: " channel) ; ; Agent
119
120
(swap! ds-clients assoc channel {:name nil :gravatar-url (calc-gravatar (get-in req [:session :cemerick.friend/identity :authentications nil :username ])) :room nil }) ; ; Add to ds-clients
120
121
(swap! ds-agents assoc channel {}))
You can’t perform that action at this time.
0 commit comments