This commit is contained in:
parent
13cfda928d
commit
54b932e9c1
@ -58,6 +58,14 @@ func (id *Identity) CreateFolder() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (id *Identity) Wipe() error {
|
||||
err := os.RemoveAll(filepath.Join(GetConfig().StoragePath, id.Uuid))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Creates an invitation for a peer, returns the newly created peer including infos to provide a ContactCard
|
||||
func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerUids []string, InvitationMessage string) (*Peer, error) {
|
||||
var peer Peer
|
||||
|
@ -43,7 +43,7 @@ func (r *RedisRouter) Route(msg *meowlib.ToServerMessage) (*meowlib.FromServerMe
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// user message
|
||||
// user message => store
|
||||
if len(msg.Messages) > 0 {
|
||||
// update messages counter
|
||||
err := r.Client.Incr("statistics:messages:usermessages").Err()
|
||||
@ -62,6 +62,7 @@ func (r *RedisRouter) Route(msg *meowlib.ToServerMessage) (*meowlib.FromServerMe
|
||||
}
|
||||
// check for messages
|
||||
if len(msg.PullRequest) > 0 {
|
||||
//dataFound := false
|
||||
// update messages counter
|
||||
err := r.Client.Incr("statistics:messages:messagelookups").Err()
|
||||
if err != nil {
|
||||
@ -96,13 +97,15 @@ func (r *RedisRouter) Route(msg *meowlib.ToServerMessage) (*meowlib.FromServerMe
|
||||
if msgcnt == 0 {
|
||||
// get invitation answer
|
||||
var answer meowlib.Invitation
|
||||
storedAanswer, err := r.GetAnswerToInvitation(rq.LookupKey)
|
||||
storedAnswer, err := r.GetAnswerToInvitation(rq.LookupKey)
|
||||
if err != nil {
|
||||
err := proto.Unmarshal(storedAanswer, &answer)
|
||||
err := proto.Unmarshal(storedAnswer, &answer)
|
||||
if err != nil {
|
||||
from_server.Invitation.Payload = []byte("invitation answer corrupted")
|
||||
}
|
||||
from_server.Invitation = &answer
|
||||
// exit loop if invitation found, cannot store several in a message
|
||||
break
|
||||
}
|
||||
// add invitation answer to the response
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user