// ActivateMessageTrace set a MessageTrace function to dump out the message trace
344122
func ActivateMessageTrace() {
	MessageTrace = func(msg *Message, pluginID string, comment string) {
		mt := messageTracer{
			msg:      msg,
			pluginID: pluginID,
		}

		mt.Dump(comment)
	}
}
971478
func ActivateFileCustomRules(qsc tabletserver.Controller) {
	if *fileRulePath != "" {
		qsc.RegisterQueryRuleSource(FileCustomRuleSource)
		fileCustomRule.Open(qsc, *fileRulePath)
	}
}
984684
func (s *UpdateUserPoolInput) SetSmsVerificationMessage(v string) *UpdateUserPoolInput {
	s.SmsVerificationMessage = &v
	return s
}
441472
func (tr *TaskRunner) emitExitResultEvent(result *drivers.ExitResult) {
	event := structs.NewTaskEvent(structs.TaskTerminated).
		SetExitCode(result.ExitCode).
		SetSignal(result.Signal).
		SetOOMKilled(result.OOMKilled).
		SetExitMessage(result.Err)

	tr.EmitEvent(event)

	if result.OOMKilled && !tr.clientConfig.DisableTaggedMetrics {
		metrics.IncrCounterWithLabels([]string{"client", "allocs", "oom_killed"}, 1, tr.baseLabels)
	}
}
6740
func MessageType(name string) reflect.Type {
	if t, ok := protoTypedNils[name]; ok {
		return reflect.TypeOf(t)
	}
	return protoMapTypes[name]
}
500078
func (a *SetPausedInDebuggerMessageArgs) SetMessage(message string) *SetPausedInDebuggerMessageArgs {
	a.Message = &message
	return a
}
559048
func (s *RouteSettings) SetDataTraceEnabled(v bool) *RouteSettings {
	s.DataTraceEnabled = &v
	return s
}
1332768
func (c *Overlay) SetPausedInDebuggerMessage(message string) (*gcdmessage.ChromeResponse, error) {
	var v OverlaySetPausedInDebuggerMessageParams
	v.Message = message
	return c.SetPausedInDebuggerMessageWithParams(&v)
}
386982
func (s *SMSMessage) SetMessageType(v string) *SMSMessage {
	s.MessageType = &v
	return s
}
70899
func (mr *MockDebugInfoMockRecorder) EnableDatapathPacketTracing(contextID, direction, interval, putype interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableDatapathPacketTracing", reflect.TypeOf((*MockDebugInfo)(nil).EnableDatapathPacketTracing), contextID, direction, interval, putype)
}
1267517
func (f *Filter) Trigger(msg *ReceivedMessage) {
	f.mutex.Lock()
	defer f.mutex.Unlock()

	if _, exist := f.Messages[msg.EnvelopeHash]; !exist {
		f.Messages[msg.EnvelopeHash] = msg
	}
}
294984
func (s *SmsMfaConfigType) SetSmsAuthenticationMessage(v string) *SmsMfaConfigType {
	s.SmsAuthenticationMessage = &v
	return s
}
632376
func handleReceivedMessage(msg []byte) error {
	// ignore empty messages
	if len(msg) == 0 {
		return nil
	}

	macpos := len(msg) - 10
	tmac := msg[macpos:]
	aesKey := registrationInfo.signalingKey[:32]
	macKey := registrationInfo.signalingKey[32:]
	if !axolotl.ValidTruncMAC(msg[:macpos], tmac, macKey) {
		return ErrInvalidMACForMessage
	}
	ciphertext := msg[1:macpos]

	plaintext, err := axolotl.Decrypt(aesKey, ciphertext)
	if err != nil {
		return err
	}
	env := &textsecure.Envelope{}
	err = proto.Unmarshal(plaintext, env)
	if err != nil {
		return err
	}

	recid := recID(env.GetSource())
	sc := axolotl.NewSessionCipher(textSecureStore, textSecureStore, textSecureStore, textSecureStore, recid, env.GetSourceDevice())
	switch *env.Type {
	case textsecure.Envelope_RECEIPT:
		handleReceipt(env)
		return nil
	case textsecure.Envelope_CIPHERTEXT:
		msg, legacy := getMessage(env)
		wm, err := axolotl.LoadWhisperMessage(msg)
		if err != nil {
			return err
		}
		b, err := sc.SessionDecryptWhisperMessage(wm)
		if _, ok := err.(axolotl.DuplicateMessageError); ok {
			log.Infof("Incoming WhisperMessage %s. Ignoring.\n", err)
			return nil
		}
		if _, ok := err.(axolotl.InvalidMessageError); ok {
			log.Infof("Incoming WhisperMessage %s. Ignoring.\n", err)
			return nil
		}
		if err != nil {
			return err
		}
		err = handleMessage(env.GetSource(), env.GetTimestamp(), b, legacy)
		if err != nil {
			return err
		}

	case textsecure.Envelope_PREKEY_BUNDLE:
		msg, legacy := getMessage(env)
		pkwm, err := axolotl.LoadPreKeyWhisperMessage(msg)
		if err != nil {
			return err
		}
		b, err := sc.SessionDecryptPreKeyWhisperMessage(pkwm)
		if _, ok := err.(axolotl.DuplicateMessageError); ok {
			log.Infof("Incoming PreKeyWhisperMessage %s. Ignoring.\n", err)
			return nil
		}
		if _, ok := err.(axolotl.PreKeyNotFoundError); ok {
			log.Infof("Incoming PreKeyWhisperMessage %s. Ignoring.\n", err)
			return nil
		}
		if _, ok := err.(axolotl.InvalidMessageError); ok {
			log.Infof("Incoming PreKeyWhisperMessage %s. Ignoring.\n", err)
			return nil
		}
		if err != nil {
			return err
		}
		err = handleMessage(env.GetSource(), env.GetTimestamp(), b, legacy)
		if err != nil {
			return err
		}
	default:
		return MessageTypeNotImplementedError{uint32(*env.Type)}
	}

	return nil
}
537905
func (t *Task) Activate(c context.Context, s dm.DepsServer) (*ActivatedTask, error) {
	newTok := model.MakeRandomToken(c, 32)
	_, err := s.ActivateExecution(c, &dm.ActivateExecutionReq{
		Auth: t.Auth, ExecutionToken: newTok})
	if err != nil {
		return nil, err
	}

	return &ActivatedTask{
		s,
		c,
		&dm.Execution_Auth{Id: t.Auth.Id, Token: newTok},
		t.Desc,
		t.State,
	}, nil
}
142711
func (s *MessageConfiguration) SetSMSMessage(v *CampaignSmsMessage) *MessageConfiguration {
	s.SMSMessage = v
	return s
}
671593
func (s *Diagnostics) SetMessage(v string) *Diagnostics {
	s.Message = &v
	return s
}
393057
func (s *server) OnNewMessage(callback func(c *Client, message string)) {
	s.onNewMessage = callback
}