Minor fixes

This commit is contained in:
Sarah Jamie Lewis 2018-05-03 10:59:58 -07:00
parent 979ad542f7
commit e839e8d12e
3 changed files with 13 additions and 4 deletions

View File

@ -263,7 +263,16 @@ func main() {
if m.Verified {
verified = "verified"
}
fmt.Printf("%v %v: %v [%s]\n", m.Timestamp, m.PeerID, m.Message, verified)
p, ok := app.Peer.Profile.Contacts[m.PeerID]
name := "unknown"
if ok {
name = p.Name
} else if app.Peer.Profile.Onion == m.PeerID {
name = app.Peer.Profile.Name
}
fmt.Printf("%v %v (%v): %v [%s]\n", m.Timestamp, name, m.PeerID, m.Message, verified)
}
}
} else {

View File

@ -41,11 +41,11 @@ func (t Timeline) Swap(i, j int) {
}
func (t Timeline) Less(i, j int) bool {
if compareSignatures(t.Messages[i].PreviousMessageSig, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) {
if t.Messages[i].Timestamp.Before(t.Messages[j].Timestamp) {
return true
}
if t.Messages[i].Timestamp.Before(t.Messages[j].Timestamp) {
if compareSignatures(t.Messages[i].PreviousMessageSig, []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) {
return true
}

View File

@ -1 +1 @@
{"Name":"Sarah","Ed25519PublicKey":"pjGwKR7x//668k6L5wauq2kRHVZ/lYky5MjXpwEfMd0=","Trusted":false,"Blocked":false,"Onion":"3lyxnb3fvvoxckmd","Contacts":{},"Ed25519PrivateKey":"dp1Q4qWVlARsj/BQOUbYYnf3dv5lcDMGZBWLnhJSObSmMbApHvH//rryTovnBq6raREdVn+ViTLkyNenAR8x3Q==","OnionPrivateKey":{"N":104322982725073731343467255206252886552056394891229470830430445244399535822960412330061824331803282799656157319003354545152087182167549118638892463467050712913051438261600330540653694100091527418204046955338894680514656487165220800975241292027426651186322677654572046274767746004077197562589739087897592388461,"E":65537,"D":37711762572893507015244560219285855857069564541680537611482485897814507883817616438218024631044319587510170179356828547678381638352860310506645121870056578049998372381097845595468504449855843030205150374468862641585067268172868653777280578453378382612290205222199733083704617982297305686009347195060622538389,"Primes":[10269478124505799344617374185000453210872409922153471500829708056024847939877279592930504708378550618626013433035769805183604484066733989558479869055996567,10158547636041056589030357328688081084488449355054217828575319683339602102460878475710722876178116196087450209800800570618256001956005080929114943060080283],"Precomputed":{"Dp":5003348284411403834072855909288866915225842635676951111913767463095249930883036107882127887125244079721815293907748750774562326262276519929234817262889213,"Dq":894842539372644760798819794292022706269005571306712231630457917388948577711928398313593896030887358286355037020004298246474386976700449092936517788208851,"Qinv":2292076693255724557620015290537832426320764862565620479893520205435832971255410669098215083615971634730254402569251452252795647765272350723031334156178634,"CRTValues":[]}},"Groups":{}}
{"Name":"Sarah","Ed25519PublicKey":"Q6dF7nCKD6BfqgGLBk0FCCYBdWBLv7Ts8uqw2zOf02A=","Trusted":false,"Blocked":false,"Onion":"lrkqzljkc5cgzmpz","Contacts":{},"Ed25519PrivateKey":"Fy9HObWaw9EH8N3jXNQtD9UgL0Yd7feY5L+oR7uNnXdDp0XucIoPoF+qAYsGTQUIJgF1YEu/tOzy6rDbM5/TYA==","OnionPrivateKey":{"N":107498703462635665473764971520727195625141645315352207633904323688914544197828221612438071393137838030896432787991102883141045406182879952109587171872209559960156106354960716467157362368090179490551994133414470776568822115434428749245942446198318143880845039325380939873177604289430737365718905329111360343777,"E":65537,"D":66650934838346851867814606295271813891877956204037743640936696656474260172643727314338596411016111670467760958042487061561457482564584036102063950773690623873787097606677998053221231028080886156972583586531026258726212233434099244761970868656273357504083063877021130260355845678915219099393211715317011636225,"Primes":[10332071347522235902804485468145791866057055098286157383486988408098332066944447770996594012391982280205811088346484428102348931474084528799982497053772929,10404370996568393072795074320321443437318186756296376448713064693902356814671757730321014302625680493962881120033122151552975123796575551159729969846473313],"Precomputed":{"Dp":1495964493593519637482822872686198926057271401309753992582938386017746814520589360193275258000633533070981909720002300048265697403872439900865677625513089,"Dq":9954139888243813632868821504775543966969614535400447071284280168032892482669848809815187112454533967864971071413045943887011813741384006488948667765441249,"Qinv":9010750810541828585160172405562139672487565596169846634421581721158830598191896975588357263133581085970784950793654150830626201363086339113136601110542205,"CRTValues":[]}},"Groups":{}}