Skip to content

Commit

Permalink
only send in client_id when unsubscribing a session
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Jan 27, 2025
1 parent b555e93 commit d8c1f3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lavinmq/mqtt/broker.cr
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ module LavinMQ
qos
end

def unsubscribe(client, packet)
session = sessions[client.client_id]
def unsubscribe(client_id, packet)
session = sessions[client_id]
packet.topics.each do |tf|
session.unsubscribe(tf)
end
Expand Down
2 changes: 1 addition & 1 deletion src/lavinmq/mqtt/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module LavinMQ
end

def recieve_unsubscribe(packet : MQTT::Unsubscribe)
@broker.unsubscribe(self, packet)
@broker.unsubscribe(self.client_id, packet)
send(MQTT::UnsubAck.new(packet.packet_id))
end

Expand Down

0 comments on commit d8c1f3a

Please sign in to comment.