fix: resolve im backend issue list regressions
This commit is contained in:
+13
-1
@@ -756,7 +756,7 @@ func (s *Session) subscribe(msg *ClientComMessage) {
|
||||
// client complete the alias->canonical rename with a 200 reply instead of
|
||||
// a 304 that would leave the client-side alias topic object unattached
|
||||
// (publishes on it then fail with "Cannot publish on inactive topic").
|
||||
if sub := s.getSub(msg.RcptTo); sub != nil && msg.Original == msg.RcptTo {
|
||||
if sub := s.getSub(msg.RcptTo); sub != nil && canReplyAlreadySubscribed(msg.Original, msg.RcptTo) {
|
||||
s.queueOut(InfoAlreadySubscribed(msg.Id, msg.Original, msg.Timestamp))
|
||||
s.inflightReqs.Done()
|
||||
} else {
|
||||
@@ -772,6 +772,18 @@ func (s *Session) subscribe(msg *ClientComMessage) {
|
||||
}
|
||||
}
|
||||
|
||||
func canReplyAlreadySubscribed(original, routeTo string) bool {
|
||||
if original == routeTo {
|
||||
return true
|
||||
}
|
||||
switch original {
|
||||
case "me", "fnd", "slf":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Leave/Unsubscribe a topic
|
||||
func (s *Session) leave(msg *ClientComMessage) {
|
||||
// Expand topic name
|
||||
|
||||
Reference in New Issue
Block a user