예제 #1
0
func ConversationName(metadata *proto.ConversationMetadata) string {
	names := make([]string, 0, len(metadata.Participants))
	already := make(map[string]struct{})
	for _, s := range metadata.Participants {
		if _, ok := already[s]; !ok {
			names = append(names, encoding.EscapeFilename(s))
			already[s] = struct{}{}
		}
	}
	sort.Strings(names)
	return encoding.EscapeFilename(metadata.Subject) + " %between " + strings.Join(names, " %and ")
}
예제 #2
0
func (d *Daemon) profilePath(name string) string {
	return filepath.Join(d.profilesDir(), encoding.EscapeFilename(name))
}
예제 #3
0
func (d *Daemon) ratchetPath(name string) string {
	return filepath.Join(d.ratchetKeysDir(), encoding.EscapeFilename(name))
}