Merge pull request 'tag unpassworded users' (#62) from tagPass into trunk
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #62
This commit is contained in:
commit
b37f283fe3
|
@ -0,0 +1,5 @@
|
||||||
|
package constants
|
||||||
|
|
||||||
|
// We offer "un-passworded" profiles but our storage encrypts everything with a password. We need an agreed upon
|
||||||
|
// password to use in that case, that the app case use behind the scenes to password and unlock with
|
||||||
|
const DefactoPasswordForUnencryptedProfiles = "be gay do crime"
|
11
lib.go
11
lib.go
|
@ -12,6 +12,7 @@ import (
|
||||||
"cwtch.im/cwtch/peer"
|
"cwtch.im/cwtch/peer"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.openprivacy.ca/flutter/libcwtch-go/constants"
|
||||||
contact "git.openprivacy.ca/flutter/libcwtch-go/features/contacts"
|
contact "git.openprivacy.ca/flutter/libcwtch-go/features/contacts"
|
||||||
"git.openprivacy.ca/flutter/libcwtch-go/features/groups"
|
"git.openprivacy.ca/flutter/libcwtch-go/features/groups"
|
||||||
"git.openprivacy.ca/flutter/libcwtch-go/utils"
|
"git.openprivacy.ca/flutter/libcwtch-go/utils"
|
||||||
|
@ -91,7 +92,7 @@ func _startCwtch(appDir string, torPath string) {
|
||||||
|
|
||||||
// Ensure that the application directory exists...and then initialize settings..
|
// Ensure that the application directory exists...and then initialize settings..
|
||||||
os.MkdirAll(path.Join(appDir), 0700)
|
os.MkdirAll(path.Join(appDir), 0700)
|
||||||
utils.InitGlobalSettingsFile(appDir, "be gay do crime")
|
utils.InitGlobalSettingsFile(appDir, constants.DefactoPasswordForUnencryptedProfiles)
|
||||||
|
|
||||||
log.Infof("Loading Cwtch Directory %v and tor path: %v", appDir, torPath)
|
log.Infof("Loading Cwtch Directory %v and tor path: %v", appDir, torPath)
|
||||||
|
|
||||||
|
@ -143,7 +144,7 @@ func _startCwtch(appDir string, torPath string) {
|
||||||
settings := utils.ReadGlobalSettings()
|
settings := utils.ReadGlobalSettings()
|
||||||
settingsJson, _ := json.Marshal(settings)
|
settingsJson, _ := json.Marshal(settings)
|
||||||
|
|
||||||
newApp.LoadProfiles("be gay do crime")
|
newApp.LoadProfiles(constants.DefactoPasswordForUnencryptedProfiles)
|
||||||
application = newApp
|
application = newApp
|
||||||
|
|
||||||
// Send global settings to the UI...
|
// Send global settings to the UI...
|
||||||
|
@ -351,7 +352,11 @@ func c_CreateProfile(nick_ptr *C.char, nick_len C.int, pass_ptr *C.char, pass_le
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateProfile(nick, pass string) {
|
func CreateProfile(nick, pass string) {
|
||||||
application.CreatePeer(nick, pass)
|
if pass == constants.DefactoPasswordForUnencryptedProfiles {
|
||||||
|
application.CreateTaggedPeer(nick, pass, constants.ProfileTypeV1DefaultPassword)
|
||||||
|
} else {
|
||||||
|
application.CreateTaggedPeer(nick, pass, constants.ProfileTypeV1Password)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//export c_LoadProfiles
|
//export c_LoadProfiles
|
||||||
|
|
Loading…
Reference in New Issue