本文整理汇总了Golang中github.com/twstrike/coyim/config.ApplicationConfig.NotifyCommand方法的典型用法代码示例。如果您正苦于以下问题:Golang ApplicationConfig.NotifyCommand方法的具体用法?Golang ApplicationConfig.NotifyCommand怎么用?Golang ApplicationConfig.NotifyCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/twstrike/coyim/config.ApplicationConfig
的用法示例。
在下文中一共展示了ApplicationConfig.NotifyCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: importFrom
func (x *xmppClientImporter) importFrom(f string) (*config.ApplicationConfig, bool) {
contents, err := ioutil.ReadFile(f)
if err != nil {
return nil, false
}
c := new(xmppClientConfig)
err = json.Unmarshal(contents, c)
if err != nil {
return nil, false
}
a := new(config.ApplicationConfig)
ac, err := a.AddNewAccount()
if err != nil {
return nil, false
}
ac.Account = c.Account
ac.Server = c.Server
ac.Proxies = c.Proxies
ac.Password = c.Password
ac.Port = c.Port
ac.HideStatusUpdates = c.HideStatusUpdates
ac.OTRAutoStartSession = c.OTRAutoStartSession
ac.OTRAutoTearDown = c.OTRAutoTearDown
ac.OTRAutoAppendTag = c.OTRAutoAppendTag
ac.ServerCertificateSHA256 = c.ServerCertificateSHA256
ac.PrivateKeys = [][]byte{c.PrivateKey}
ac.AlwaysEncryptWith = c.AlwaysEncryptWith
ac.KnownFingerprints = make([]config.KnownFingerprint, len(c.KnownFingerprints))
for ix, kf := range c.KnownFingerprints {
fp, err := hex.DecodeString(kf.FingerprintHex)
if err != nil {
continue
}
ac.KnownFingerprints[ix] = config.KnownFingerprint{
UserID: kf.UserID,
Fingerprint: fp,
Untrusted: false,
}
}
ac.RequireTor = len(c.Proxies) > 0
a.NotifyCommand = c.NotifyCommand
a.Bell = c.Bell
a.RawLogFile = c.RawLogFile
a.IdleSecondsBeforeNotification = c.IdleSecondsBeforeNotification
return a, true
}
示例2: importFrom
func (x *xmppClientImporter) importFrom(f string) (*config.ApplicationConfig, bool) {
contents, err := ioutil.ReadFile(f)
if err != nil {
return nil, false
}
c := new(xmppClientConfig)
err = json.Unmarshal(contents, c)
if err != nil {
return nil, false
}
a := new(config.ApplicationConfig)
ac, err := a.AddNewAccount()
if err != nil {
return nil, false
}
ac.Account = c.Account
ac.Server = c.Server
ac.Proxies = c.Proxies
ac.Password = c.Password
ac.Port = c.Port
ac.HideStatusUpdates = c.HideStatusUpdates
ac.OTRAutoStartSession = c.OTRAutoStartSession
ac.OTRAutoTearDown = c.OTRAutoTearDown
ac.OTRAutoAppendTag = c.OTRAutoAppendTag
ac.LegacyServerCertificateSHA256 = c.ServerCertificateSHA256
ac.PrivateKeys = [][]byte{c.PrivateKey}
ac.AlwaysEncryptWith = c.AlwaysEncryptWith
ac.Peers = nil
for _, kfpr := range c.KnownFingerprints {
fp, _ := hex.DecodeString(kfpr.FingerprintHex)
fpr, _ := ac.EnsurePeer(kfpr.UserID).EnsureHasFingerprint(fp)
fpr.Trusted = true
}
a.NotifyCommand = c.NotifyCommand
a.Bell = c.Bell
a.RawLogFile = c.RawLogFile
a.IdleSecondsBeforeNotification = c.IdleSecondsBeforeNotification
return a, true
}