X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/4c3b4c7fe03bcc7e70fd846b954ffc83bdbcfaa3..e75ba43a4e6032b94bf3a3fedf9f557f2c4969e4:/hotline/client.go?ds=sidebyside diff --git a/hotline/client.go b/hotline/client.go index fb3f4e7..e676e65 100644 --- a/hotline/client.go +++ b/hotline/client.go @@ -46,6 +46,12 @@ func (cp *ClientPrefs) IconBytes() []byte { return iconBytes } +func (cp *ClientPrefs) AddBookmark(name, addr, login, pass string) error { + cp.Bookmarks = append(cp.Bookmarks, Bookmark{Addr: addr, Login: login, Password: pass}) + + return nil +} + func readConfig(cfgPath string) (*ClientPrefs, error) { fh, err := os.Open(cfgPath) if err != nil { @@ -612,8 +618,8 @@ func (c *Client) LogIn(login string, password string) error { tranLogin, nil, NewField(fieldUserName, []byte(c.pref.Username)), NewField(fieldUserIconID, c.pref.IconBytes()), - NewField(fieldUserLogin, []byte(NegatedUserString([]byte(login)))), - NewField(fieldUserPassword, []byte(NegatedUserString([]byte(password)))), + NewField(fieldUserLogin, negateString([]byte(login))), + NewField(fieldUserPassword, negateString([]byte(password))), NewField(fieldVersion, []byte{0, 2}), ), )