X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/3d2bd095b354c5ba84f51073b26c752290467784..da1e0d79561ded0b3998a50a1d14a16b5c9a24bc:/hotline/client.go diff --git a/hotline/client.go b/hotline/client.go index 5016a50..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 { @@ -288,7 +294,7 @@ func handleGetFileNameList(c *Client, t *Transaction) (res []Transaction, err er } else { size := binary.BigEndian.Uint32(fn.FileSize) / 1024 - node := tview.NewTreeNode(fmt.Sprintf(" %-30s %15v KB", fn.Name, size)) + node := tview.NewTreeNode(fmt.Sprintf(" %-40s %10v KB", fn.Name, size)) node.SetReference(&fn) root.AddChild(node) } @@ -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}), ), )