libnmdc: fix PM detection
This commit is contained in:
parent
c532e2fe4f
commit
d6339667fe
@ -69,7 +69,7 @@ var rx_incomingTo *regexp.Regexp
|
|||||||
func init() {
|
func init() {
|
||||||
rx_protocolMessage = regexp.MustCompile("(?ms)^[^|]*|")
|
rx_protocolMessage = regexp.MustCompile("(?ms)^[^|]*|")
|
||||||
rx_publicChat = regexp.MustCompile("(?ms)^<([^>]*)> (.*)$")
|
rx_publicChat = regexp.MustCompile("(?ms)^<([^>]*)> (.*)$")
|
||||||
rx_incomingTo = regexp.MustCompile("(?ms)^([^ ]+) From: ([^ ]+) $<([^>]*)> (.*)$")
|
rx_incomingTo = regexp.MustCompile("(?ms)^([^ ]+) From: ([^ ]+) \\$<([^>]*)> (.*)")
|
||||||
}
|
}
|
||||||
|
|
||||||
type HubConnectionOptions struct {
|
type HubConnectionOptions struct {
|
||||||
@ -273,15 +273,19 @@ func (this *HubConnection) processProtocolMessage(message string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$To":
|
case "$To:":
|
||||||
|
valid := false
|
||||||
if rx_incomingTo.MatchString(commandParts[1]) {
|
if rx_incomingTo.MatchString(commandParts[1]) {
|
||||||
txparts := rx_incomingTo.FindStringSubmatch(commandParts[1])
|
txparts := rx_incomingTo.FindStringSubmatch(commandParts[1])
|
||||||
if txparts[0] == this.Hco.Self.Nick && txparts[1] == txparts[2] {
|
if txparts[1] == this.Hco.Self.Nick && txparts[2] == txparts[3] {
|
||||||
this.OnEvent <- HubEvent{EventType: EVENT_PRIVATE, Nick: txparts[1], Message: txparts[3]}
|
this.OnEvent <- HubEvent{EventType: EVENT_PRIVATE, Nick: txparts[2], Message: txparts[4]}
|
||||||
break
|
valid = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.OnEvent <- HubEvent{EventType: EVENT_DEBUG_MESSAGE, Message: "Malformed private message '" + commandParts[1] + "'"}
|
|
||||||
|
if !valid {
|
||||||
|
this.OnEvent <- HubEvent{EventType: EVENT_DEBUG_MESSAGE, Message: "Malformed private message '" + commandParts[1] + "'"}
|
||||||
|
}
|
||||||
|
|
||||||
case "$UserIP":
|
case "$UserIP":
|
||||||
// Final message in PtokaX connection handshake - trigger connection callback.
|
// Final message in PtokaX connection handshake - trigger connection callback.
|
||||||
|
Loading…
Reference in New Issue
Block a user