Skip to content

Commit

Permalink
RSET doesn't logout the user
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed May 18, 2019
1 parent 469c269 commit 83256d2
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (c *Conn) Session() Session {
return c.session
}

// Setting the user resets any message beng generated
// Setting the user resets any message being generated
func (c *Conn) SetSession(session Session) {
c.locker.Lock()
defer c.locker.Unlock()
Expand Down Expand Up @@ -471,7 +471,7 @@ func (c *Conn) handleData(arg string) {
c.WriteResponse(code, enhancedCode, msg)
}

c.resetMessage()
c.reset()
}

func (c *Conn) Reject() {
Expand Down Expand Up @@ -526,19 +526,6 @@ func (c *Conn) reset() {
c.locker.Lock()
defer c.locker.Unlock()

if c.session != nil {
c.session.Logout()
}

c.session = nil
c.fromReceived = false
c.recipients = nil
}

func (c *Conn) resetMessage() {
c.locker.Lock()
defer c.locker.Unlock()

if c.session != nil {
c.session.Reset()
}
Expand Down

0 comments on commit 83256d2

Please sign in to comment.