MCPcopy
hub / github.com/davyxu/cellnet / IsMsgLogValid

Function IsMsgLogValid

msglog/listbase.go:81–101  ·  view source on GitHub ↗

能否显示消息日志

(msgid int)

Source from the content-addressed store, hash-verified

79
80// 能否显示消息日志
81func IsMsgLogValid(msgid int) bool {
82 switch GetCurrMsgLogMode() {
83 case MsgLogMode_BlackList: // 黑名单里不显示
84 if _, ok := blackListByMsgID.Load(msgid); ok {
85 return false
86 } else {
87 return true
88 }
89 case MsgLogMode_WhiteList: // 只有在白名单里才显示
90 if _, ok := whiteListByMsgID.Load(msgid); ok {
91 return true
92 } else {
93 return false
94 }
95 case MsgLogMode_Mute:
96 return false
97 }
98
99 // MsgLogMode_ShowAll
100 return true
101}
102
103// 遍历消息规则
104func VisitMsgLogRule(mode MsgLogMode, callback func(*cellnet.MessageMeta) bool) {

Callers 6

ResolveInboundEventFunction · 0.92
ResolveOutboundEventFunction · 0.92
ResoleveInboundEventFunction · 0.92
ResolveOutboundEventFunction · 0.92
WriteRecvLoggerFunction · 0.85
WriteSendLoggerFunction · 0.85

Calls 1

GetCurrMsgLogModeFunction · 0.85

Tested by

no test coverage detected