One user, vigoux, said that his private buffers do not get reopened on startup (namely one dating from the day before). Investigate.
Looked a bit into it, it seems like senpai does things correctly and send a CHATHISTORY TARGETS timespan=.. timespan=.. 1000 at the beginning (https://ircv3.net/specs/extensions/chathistory#targets). The problem seems to be, that in my case, ergo.chat is not mentioning PRIVMSGS unless there are unread messages. Not sure if this is a problem of the spec or ergo.chat.
I could work around this a bit by changing the line in app.go that retrieves targets since the client disconnected the last time to retrieving target since one week before we last logged out.
s.NewHistoryRequest(""). WithLimit(1000). Targets(app.lastCloseTime.Add(-time.Hour*24*7), msg.TimeOrNow())
The problem is now, that the irc server doesn't know if we parted a privmsg buffer or not, it's a complete client side thing and those privmsg buffers will get reopened each time one starts senpai (until the last message in that privmsg conversation was longer ago then one week since the last logout).
Another way to fix this would be to safe the open buffers. Currently the lastbuffer is already saved in ~/.cache/senpai/lastbuffer.txt. Something similiar could be done by saving all open buffers (or maybe only query buffers) to ~/.cache/senpai/buffers.txt.
Check out https://lists.sr.ht/~taiite/public-inbox/%3Cf602464387da3cd94bf910ccf5e89690%40riseup.net%3E
This implements reopening buffers
Ideally the bouncer would handle keeping track of the buffers.
Relevant issue for soju: https://todo.sr.ht/~emersion/soju/187
OK, I'd like to avoid reopening conversations with messages earlier than last close.
The real fix is indeed https://todo.sr.ht/~emersion/soju/187
Waiting on a soju spec to add this to senpai.