|
@@ -353,7 +353,7 @@ func (server *Server) AddAlwaysOnClient(account ClientAccount, chnames []string)
|
353
|
353
|
}
|
354
|
354
|
|
355
|
355
|
func (client *Client) resizeHistory(config *Config) {
|
356
|
|
- _, ephemeral := client.historyStatus(config)
|
|
356
|
+ _, ephemeral, _ := client.historyStatus(config)
|
357
|
357
|
if ephemeral {
|
358
|
358
|
client.history.Resize(config.History.ClientLength, config.History.AutoresizeWindow)
|
359
|
359
|
} else {
|
|
@@ -756,7 +756,7 @@ func (session *Session) playResume() {
|
756
|
756
|
}
|
757
|
757
|
}
|
758
|
758
|
}
|
759
|
|
- _, cEphemeral := client.historyStatus(config)
|
|
759
|
+ _, cEphemeral, _ := client.historyStatus(config)
|
760
|
760
|
if cEphemeral {
|
761
|
761
|
lastDiscarded := client.history.LastDiscarded()
|
762
|
762
|
if oldestLostMessage.Before(lastDiscarded) {
|
|
@@ -1543,20 +1543,23 @@ func (client *Client) attemptAutoOper(session *Session) {
|
1543
|
1543
|
}
|
1544
|
1544
|
}
|
1545
|
1545
|
|
1546
|
|
-func (client *Client) historyStatus(config *Config) (persistent, ephemeral bool) {
|
|
1546
|
+func (client *Client) historyStatus(config *Config) (persistent, ephemeral bool, target string) {
|
1547
|
1547
|
if !config.History.Enabled {
|
1548
|
|
- return false, false
|
|
1548
|
+ return
|
1549
|
1549
|
} else if !config.History.Persistent.Enabled {
|
1550
|
|
- return false, true
|
|
1550
|
+ ephemeral = true
|
|
1551
|
+ return
|
1551
|
1552
|
}
|
1552
|
1553
|
|
1553
|
1554
|
client.stateMutex.RLock()
|
1554
|
1555
|
alwaysOn := client.alwaysOn
|
1555
|
1556
|
historyStatus := client.accountSettings.DMHistory
|
|
1557
|
+ target = client.nickCasefolded
|
1556
|
1558
|
client.stateMutex.RUnlock()
|
1557
|
1559
|
|
1558
|
1560
|
if !alwaysOn {
|
1559
|
|
- return false, true
|
|
1561
|
+ ephemeral = true
|
|
1562
|
+ return
|
1560
|
1563
|
}
|
1561
|
1564
|
|
1562
|
1565
|
historyStatus = historyEnabled(config.History.Persistent.DirectMessages, historyStatus)
|