Fix function name and update file path handling
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is failing
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	continuous-integration/drone/push Build is failing
				
			This commit is contained in:
		| @@ -125,7 +125,7 @@ func ReadMessage(messageFilename string) ([]string, []string, string, error) { | |||||||
| 	} | 	} | ||||||
| 	// check if invitation answer | 	// check if invitation answer | ||||||
| 	if fromServerMessage.Invitation != nil { | 	if fromServerMessage.Invitation != nil { | ||||||
| 		InvitationGetAnswerReadResponse(fromServerMessage.Invitation) | 		invitationGetAnswerReadResponse(fromServerMessage.Invitation) | ||||||
| 	} | 	} | ||||||
| 	// Chat messages | 	// Chat messages | ||||||
| 	if len(fromServerMessage.Chat) > 0 { | 	if len(fromServerMessage.Chat) > 0 { | ||||||
|   | |||||||
| @@ -9,11 +9,11 @@ import ( | |||||||
| // Got it by the message background check | // Got it by the message background check | ||||||
| // => noInvitationGetAnswer | // => noInvitationGetAnswer | ||||||
|  |  | ||||||
| // InvitationGetAnswerReadResponse | // invitationGetAnswerReadResponse | ||||||
| // Called by the invitation initiator | // Called by the initiator's background service only | ||||||
| // invitationAnswerData: the data received from the server | // invitationAnswerData: the data received from the server | ||||||
| // invitationServerUid: the uid of the server holding the invitation | // invitationServerUid: the uid of the server holding the invitation | ||||||
| func InvitationGetAnswerReadResponse(invitation *meowlib.Invitation) (*client.Peer, string, error) { | func invitationGetAnswerReadResponse(invitation *meowlib.Invitation) (*client.Peer, string, error) { | ||||||
|  |  | ||||||
| 	// decode the payload | 	// decode the payload | ||||||
| 	var invitationAnswer meowlib.PackedUserMessage | 	var invitationAnswer meowlib.PackedUserMessage | ||||||
| @@ -47,7 +47,7 @@ func InvitationGetAnswerReadResponse(invitation *meowlib.Invitation) (*client.Pe | |||||||
| 			peer.ContactPullServers = append(peer.ContactPullServers, server.GetUid()) | 			peer.ContactPullServers = append(peer.ContactPullServers, server.GetUid()) | ||||||
| 		} | 		} | ||||||
| 		client.GetConfig().GetIdentity().Save() | 		client.GetConfig().GetIdentity().Save() | ||||||
| 		//	cc, err := id.FinalizeInvitation(serverMsg.Invitation.) |  | ||||||
| 	} | 	} | ||||||
| 	return peer, "", nil | 	return peer, "", nil | ||||||
| } | } | ||||||
|   | |||||||
| @@ -3,6 +3,7 @@ package meowlib | |||||||
| import ( | import ( | ||||||
| 	"errors" | 	"errors" | ||||||
| 	"os" | 	"os" | ||||||
|  | 	"path/filepath" | ||||||
|  |  | ||||||
| 	"github.com/google/uuid" | 	"github.com/google/uuid" | ||||||
| ) | ) | ||||||
| @@ -30,7 +31,7 @@ func (msg *UserMessage) AddFile(filename string, maxMessageSize int64) error { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	var file File | 	var file File | ||||||
| 	file.Filename = filename | 	file.Filename = filepath.Base(filename) | ||||||
| 	file.Size = uint64(fi.Size()) | 	file.Size = uint64(fi.Size()) | ||||||
| 	file.Data = data | 	file.Data = data | ||||||
| 	msg.Files = append(msg.Files, &file) | 	msg.Files = append(msg.Files, &file) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user