Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c3069eabb | |||
| 3cc31323ad | |||
| 7f898dff32 | |||
| 58c1151278 | |||
| d1c549f1f2 |
1
.hgtags
1
.hgtags
@@ -13,3 +13,4 @@ cb86f3a40115cc46f450c0c83fd9b9d3b740e820 libnmdc-r6
|
|||||||
b0e57a5fcffdf4102d669db51a3648ddf66a0792 libnmdc-r8
|
b0e57a5fcffdf4102d669db51a3648ddf66a0792 libnmdc-r8
|
||||||
e7c2c71ef24b386add728fad35fff4a996fccbac libnmdc-r9
|
e7c2c71ef24b386add728fad35fff4a996fccbac libnmdc-r9
|
||||||
3ecc037cf2d7080572fe87c2e39ecd153fb0e947 libnmdc-r10
|
3ecc037cf2d7080572fe87c2e39ecd153fb0e947 libnmdc-r10
|
||||||
|
5149ffe70ea8475e480b682345b31aa45a3352db release-0.11
|
||||||
|
|||||||
@@ -67,10 +67,11 @@ func (this *HubConnection) UserCount() int {
|
|||||||
|
|
||||||
func (this *HubConnection) userJoined_NameOnly(nick string) {
|
func (this *HubConnection) userJoined_NameOnly(nick string) {
|
||||||
if !this.UserExists(nick) {
|
if !this.UserExists(nick) {
|
||||||
this.userLock.Lock()
|
|
||||||
defer this.userLock.Unlock()
|
|
||||||
|
|
||||||
|
this.userLock.Lock()
|
||||||
this.users[nick] = *NewUserInfo(nick)
|
this.users[nick] = *NewUserInfo(nick)
|
||||||
|
this.userLock.Unlock() // Don't lock over a processEvent boundary
|
||||||
|
|
||||||
this.processEvent(HubEvent{EventType: EVENT_USER_JOINED, Nick: nick})
|
this.processEvent(HubEvent{EventType: EVENT_USER_JOINED, Nick: nick})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,11 +79,9 @@ func (this *HubConnection) userJoined_NameOnly(nick string) {
|
|||||||
func (this *HubConnection) userJoined_Full(uinf *UserInfo) {
|
func (this *HubConnection) userJoined_Full(uinf *UserInfo) {
|
||||||
// n.b. also called when we get a replacement MyINFO for someone
|
// n.b. also called when we get a replacement MyINFO for someone
|
||||||
this.userLock.Lock()
|
this.userLock.Lock()
|
||||||
defer this.userLock.Unlock()
|
|
||||||
|
|
||||||
_, userExisted := this.users[uinf.Nick] // don't use UserExists as it would deadlock the mutex
|
_, userExisted := this.users[uinf.Nick] // don't use UserExists as it would deadlock the mutex
|
||||||
|
|
||||||
this.users[uinf.Nick] = *uinf
|
this.users[uinf.Nick] = *uinf
|
||||||
|
this.userLock.Unlock() // Don't lock over a processEvent boundary
|
||||||
|
|
||||||
if !userExisted {
|
if !userExisted {
|
||||||
this.processEvent(HubEvent{EventType: EVENT_USER_JOINED, Nick: uinf.Nick})
|
this.processEvent(HubEvent{EventType: EVENT_USER_JOINED, Nick: uinf.Nick})
|
||||||
@@ -167,15 +166,20 @@ func (this *HubConnection) processProtocolMessage(message string) {
|
|||||||
this.processEvent(HubEvent{EventType: EVENT_SYSTEM_MESSAGE_FROM_CONN, Message: "Incorrect password."})
|
this.processEvent(HubEvent{EventType: EVENT_SYSTEM_MESSAGE_FROM_CONN, Message: "Incorrect password."})
|
||||||
|
|
||||||
case "$GetPass":
|
case "$GetPass":
|
||||||
|
if len(this.Hco.NickPassword) == 0 {
|
||||||
|
// We've got a problem. MyPass with no arguments is a syntax error with no message = instant close
|
||||||
|
// Just drop the connection
|
||||||
|
this.processEvent(HubEvent{EventType: EVENT_SYSTEM_MESSAGE_FROM_CONN, Message: "This account is passworded."})
|
||||||
|
this.Disconnect()
|
||||||
|
} else {
|
||||||
this.SayRaw("$MyPass " + Escape(this.Hco.NickPassword) + "|")
|
this.SayRaw("$MyPass " + Escape(this.Hco.NickPassword) + "|")
|
||||||
|
}
|
||||||
|
|
||||||
case "$Quit":
|
case "$Quit":
|
||||||
func() {
|
|
||||||
this.userLock.Lock()
|
this.userLock.Lock()
|
||||||
defer this.userLock.Unlock()
|
|
||||||
|
|
||||||
delete(this.users, commandParts[1])
|
delete(this.users, commandParts[1])
|
||||||
}()
|
this.userLock.Unlock() // Don't lock over a processEvent boundary
|
||||||
|
|
||||||
this.processEvent(HubEvent{EventType: EVENT_USER_PART, Nick: commandParts[1]})
|
this.processEvent(HubEvent{EventType: EVENT_USER_PART, Nick: commandParts[1]})
|
||||||
|
|
||||||
case "$MyINFO":
|
case "$MyINFO":
|
||||||
|
|||||||
@@ -9,6 +9,18 @@ Tags: nmdc
|
|||||||
|
|
||||||
=CHANGELOG=
|
=CHANGELOG=
|
||||||
|
|
||||||
|
2017-02-05 0.12
|
||||||
|
- Fix an issue with mutex deadlock when accessing user information from a callback
|
||||||
|
- Fix an issue with silent disconnection if a password was required but not present
|
||||||
|
|
||||||
|
2016-11-29 0.11
|
||||||
|
- BREAKING: Remove some exported methods
|
||||||
|
- BREAKING: Fix an issue with missing sufficient parameters in the synchronous API
|
||||||
|
- Enhancement: Improve output under godoc
|
||||||
|
- Fix an issue with special characters appearing in recieved private messages
|
||||||
|
- Fix an issue with parsing active/passive connection modes
|
||||||
|
- Fix an issue with errors appearing on stdout
|
||||||
|
|
||||||
2016-10-08 r10
|
2016-10-08 r10
|
||||||
- Feature: Support `$UserCommand`
|
- Feature: Support `$UserCommand`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user