Explorar el Código

Merge pull request #1139 from slingamn/tilt

fix bug introduced in #1138
tags/v2.2.0-rc1
Shivaram Lingamneni hace 3 años
padre
commit
250076a132
No account linked to committer's email address
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6
    4
      irc/handlers.go

+ 6
- 4
irc/handlers.go Ver fichero

@@ -240,9 +240,10 @@ func authPlainHandler(server *Server, client *Client, mechanism string, value []
240 240
 	// see #843: strip the device ID for the benefit of clients that don't
241 241
 	// distinguish user/ident from account name
242 242
 	if strudelIndex := strings.IndexByte(authcid, '@'); strudelIndex != -1 {
243
-		authcid = authcid[:strudelIndex]
243
+		var deviceID string
244
+		authcid, deviceID = authcid[:strudelIndex], authcid[strudelIndex+1:]
244 245
 		if !client.registered {
245
-			rb.session.deviceID = authcid[strudelIndex+1:]
246
+			rb.session.deviceID = deviceID
246 247
 		}
247 248
 	}
248 249
 	password := string(splitValue[2])
@@ -296,9 +297,10 @@ func authExternalHandler(server *Server, client *Client, mechanism string, value
296 297
 		// see #843: strip the device ID for the benefit of clients that don't
297 298
 		// distinguish user/ident from account name
298 299
 		if strudelIndex := strings.IndexByte(authzid, '@'); strudelIndex != -1 {
299
-			authzid = authzid[:strudelIndex]
300
+			var deviceID string
301
+			authzid, deviceID = authzid[:strudelIndex], authzid[strudelIndex+1:]
300 302
 			if !client.registered {
301
-				rb.session.deviceID = authzid[strudelIndex+1:]
303
+				rb.session.deviceID = deviceID
302 304
 			}
303 305
 		}
304 306
 		err = server.accounts.AuthenticateByCertFP(client, rb.session.certfp, authzid)

Loading…
Cancelar
Guardar