|
@@ -566,15 +566,20 @@ func chathistoryHandler(server *Server, client *Client, msg ircmsg.IrcMessage, r
|
566
|
566
|
|
567
|
567
|
target := msg.Params[0]
|
568
|
568
|
channel = server.channels.Get(target)
|
569
|
|
- if channel == nil {
|
570
|
|
- cftarget, _ := Casefold(target)
|
571
|
|
- if cftarget == "me" || cftarget == "self" || cftarget == client.NickCasefolded() {
|
572
|
|
- hist = client.history
|
573
|
|
- } else {
|
574
|
|
- return
|
575
|
|
- }
|
576
|
|
- } else {
|
|
569
|
+ if channel != nil {
|
577
|
570
|
hist = &channel.history
|
|
571
|
+ } else {
|
|
572
|
+ targetClient := server.clients.Get(target)
|
|
573
|
+ if targetClient != nil {
|
|
574
|
+ myAccount := client.Account()
|
|
575
|
+ targetAccount := targetClient.Account()
|
|
576
|
+ if myAccount != "" && targetAccount != "" && myAccount == targetAccount {
|
|
577
|
+ hist = targetClient.history
|
|
578
|
+ }
|
|
579
|
+ }
|
|
580
|
+ }
|
|
581
|
+ if hist == nil {
|
|
582
|
+ return
|
578
|
583
|
}
|
579
|
584
|
|
580
|
585
|
preposition := strings.ToLower(msg.Params[1])
|
|
@@ -1013,16 +1018,25 @@ func historyHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R
|
1013
|
1018
|
target := msg.Params[0]
|
1014
|
1019
|
var hist *history.Buffer
|
1015
|
1020
|
channel := server.channels.Get(target)
|
1016
|
|
- if channel == nil {
|
1017
|
|
- cftarget, _ := Casefold(target)
|
1018
|
|
- if cftarget == "me" || cftarget == "self" || cftarget == client.NickCasefolded() {
|
|
1021
|
+ if channel != nil {
|
|
1022
|
+ hist = &channel.history
|
|
1023
|
+ } else {
|
|
1024
|
+ if strings.ToLower(target) == "me" {
|
1019
|
1025
|
hist = client.history
|
1020
|
1026
|
} else {
|
1021
|
|
- rb.Add(nil, server.name, ERR_NOSUCHCHANNEL, client.Nick(), target, client.t("No such channel"))
|
1022
|
|
- return false
|
|
1027
|
+ targetClient := server.clients.Get(target)
|
|
1028
|
+ if targetClient != nil {
|
|
1029
|
+ myAccount, targetAccount := client.Account(), targetClient.Account()
|
|
1030
|
+ if myAccount != "" && targetAccount != "" && myAccount == targetAccount {
|
|
1031
|
+ hist = targetClient.history
|
|
1032
|
+ }
|
|
1033
|
+ }
|
1023
|
1034
|
}
|
1024
|
|
- } else {
|
1025
|
|
- hist = &channel.history
|
|
1035
|
+ }
|
|
1036
|
+
|
|
1037
|
+ if hist == nil {
|
|
1038
|
+ rb.Add(nil, server.name, ERR_NOSUCHCHANNEL, client.Nick(), target, client.t("No such channel"))
|
|
1039
|
+ return false
|
1026
|
1040
|
}
|
1027
|
1041
|
|
1028
|
1042
|
limit := 10
|