@@ -236,7 +236,7 @@ var (
236236// and environment variables
237237func setupLogging () {
238238 loglevel := config .ConfigFile .LogLevel
239- if loglevel == "" {
239+ if loglevel == "" || os . Getenv ( "TEXTSECURE_LOGLEVEL" ) != "" {
240240 loglevel = os .Getenv ("TEXTSECURE_LOGLEVEL" )
241241 }
242242 fmt .Printf ("INFO[0000] [textsecure] Setting log level to %s\n " , loglevel )
@@ -250,7 +250,7 @@ func setupLogging() {
250250 case "ERROR" :
251251 log .SetLevel (log .ErrorLevel )
252252 default :
253- log .SetLevel (log .ErrorLevel )
253+ log .SetLevel (log .InfoLevel )
254254 }
255255
256256 log .SetFormatter (& log.TextFormatter {
@@ -408,6 +408,8 @@ func registerDevice() error {
408408 client .GetConfig ()
409409 phoneNumber := client .GetPhoneNumber ()
410410 captcha := client .GetCaptchaToken ()
411+ name := client .GetUsername ()
412+ registration .Registration .Name = name
411413 err = RegisterWithCrayfish (& registration .Registration , phoneNumber , captcha )
412414 if err != nil {
413415 log .Errorln ("[textsecure] Crayfish registration failed" , err )
@@ -421,6 +423,7 @@ func registerDevice() error {
421423 }
422424 config .ConfigFile .Tel = crayfishRegistration .Tel
423425 config .ConfigFile .UUID = crayfishRegistration .UUID
426+ config .ConfigFile .Name = name
424427 config .ConfigFile .AccountCapabilities = config.AccountCapabilities {
425428 // Uuid: false,
426429 Gv2 : true ,
@@ -432,6 +435,9 @@ func registerDevice() error {
432435 }
433436
434437 err = saveConfig (config .ConfigFile )
438+ if err != nil {
439+ return err
440+ }
435441 log .Debugln ("[textsecure] Crayfish registration done" )
436442 transport .SetupTransporter (config .ConfigFile .Server , config .ConfigFile .UUID , registration .Registration .Password , config .ConfigFile .UserAgent , config .ConfigFile .ProxyServer )
437443
0 commit comments