Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Feb 1, 2025
1 parent 1908109 commit e034d62
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ class Event < ApplicationRecord
self.topic = tags.find { |tag| tag[0] == "t" }&.[](1)
self.recipient = tags.find { |tag| tag[0] == "p" }&.[](1)

self.conversation ||= Conversation.find_or_create_by(pubkey: pubkey, session: session) do |c|
c.latest_event_created_at = created_at
c.events_count = 0
if session
self.conversation ||= Conversation.find_or_create_by(pubkey: pubkey, session: session) do |c|
c.latest_event_created_at = created_at
c.events_count = 0
end
end
end

Expand Down

0 comments on commit e034d62

Please sign in to comment.