File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 22 (:require [org.httpkit.server :refer [with-channel on-close on-receive send!]]
33 [chatb0x.user :refer :all ]
44 [cheshire.core :refer [generate-string]]
5+ [cemerick.friend :as friend]
56 [digest :refer [md5]]
67 [clojure.string :as str]))
78
114115 (with-channel req channel
115116 ; ; CONNECT
116117 (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) )
118119 (do (println " Agent connected: " channel) ; ; Agent
119120 (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
120121 (swap! ds-agents assoc channel {}))
You can’t perform that action at this time.
0 commit comments