[PD1] Fix adding user cert to db, also finished logs

This commit is contained in:
Afonso Franco 2024-04-28 23:32:19 +01:00
parent f2118fe570
commit 4ea8315aed
Signed by: afonso
SSH key fingerprint: SHA256:aiLbdlPwXKJS5wMnghdtod0SPy8imZjlVvCyUX9DJNk
4 changed files with 24 additions and 16 deletions

View file

@ -3,7 +3,6 @@ package client
import (
"bufio"
"fmt"
"log"
"os"
"strings"
)
@ -15,9 +14,8 @@ func readStdin(message string) string {
return scanner.Text()
}
func commandError() {
fmt.Println("MSG SERVICE: command error!")
showHelp()
func printError(err string) {
fmt.Fprintln(os.Stderr, err)
}
func showHelp() {
@ -37,7 +35,7 @@ func showMessagesInfo(page int, numPages int, messages []ClientMessageInfo) int
for _, message := range messages {
if message.decryptError != nil {
fmt.Printf("ERROR: %v:%v:%v:", message.Num, message.FromUID, message.Timestamp)
log.Println(message.decryptError)
fmt.Println(message.decryptError)
} else {
fmt.Printf("%v:%v:%v:%v\n", message.Num, message.FromUID, message.Timestamp, message.Subject)
}
@ -52,7 +50,7 @@ func messagesInfoPageNavigation(page int, numPages int) int {
switch page {
case 1:
if page == numPages {
action = readStdin("Actions: quit")
return 0
} else {
action = readStdin("Actions: quit/next")
}