示例#1
0
文件: pidgin.go 项目: twstrike/coyim
func (p *pidginImporter) findDir() (string, bool) {
	if fi, err := os.Stat(config.WithHome(filepath.Join(pidginConfigDir, pidginAccountsFile))); err == nil && !fi.IsDir() {
		return config.WithHome(pidginConfigDir), true
	}

	if config.IsWindows() {
		app := filepath.Join(config.SystemConfigDir(), pidginConfigDir)

		if fi, err := os.Stat(filepath.Join(app, pidginAccountsFile)); err == nil && !fi.IsDir() {
			return app, true
		}
	}

	return "", false
}
示例#2
0
文件: gajim.go 项目: rosatolen/coyim
func (g *gajimImporter) findFiles() (configFile string, pluginFile string, keyFiles []string, fingerprintFiles []string) {
	var configRoot, dataRoot string

	if config.IsWindows() {
		configRoot = filepath.Join(config.SystemConfigDir(), "Gajim")
		dataRoot = configRoot
	} else {
		configRoot = filepath.Join(config.XdgConfigHome(), "gajim")
		dataRoot = filepath.Join(config.XdgDataDir(), "gajim")
	}

	configFile = filepath.Join(configRoot, "config")
	pluginFile = filepath.Join(configRoot, "pluginsconfig/gotr")

	fingerprintFiles = getFilesMatching(dataRoot, gajimOtrDataFingerprintsExtension)
	keyFiles = getFilesMatching(dataRoot, gajimOtrDataKeyExtension)

	return
}