// GetMessage returns the nested message with the specified name. The name can be simple or fully qualified (returns
// `nil` if not found)
430942
func (m *Descriptor) GetMessage(name string) *Descriptor {
	for _, msg := range m.GetMessages() {
		// can lookup by name or message prefixed name (qualified)
		if msg.GetName() == name || msg.GetLongName() == name {
			return msg
		}
	}

	return nil
}
1312944
func (l *Limiter) GetMessageContentType() string {
	l.RLock()
	defer l.RUnlock()
	return l.messageContentType
}
811291
func (gitter *Gitter) GetMessage(roomID, messageID string) (*Message, error) {

	var message Message
	response, err := gitter.get(gitter.config.apiBaseURL + "rooms/" + roomID + "/chatMessages/" + messageID)
	if err != nil {
		gitter.log(err)
		return nil, err
	}

	err = json.Unmarshal(response, &message)
	if err != nil {
		gitter.log(err)
		return nil, err
	}

	return &message, nil
}
571269
func (p *PullRequestReviewDismissalRequest) GetMessage() string {
	if p == nil || p.Message == nil {
		return ""
	}
	return *p.Message
}
1183463
func parseMessage(t *thing) (*Message, error) {
	m := &Message{}
	return m, mapstructure.Decode(t.Data, m)
}
921411
func (pm *ProducerMessage) GetValue() []byte {
	val, _ := pm.Value.Encode()
	return val
}
750895
func (t *Tag) GetMessage() string {
	if t == nil || t.Message == nil {
		return ""
	}
	return *t.Message
}
1284547
func (c chatResponseFull) getMessageTimestamp() string {
	if len(c.Timestamp) > 0 {
		return c.Timestamp
	}
	return c.MessageTimeStamp
}
510841
func (d *DismissedReview) GetDismissalMessage() string {
	if d == nil || d.DismissalMessage == nil {
		return ""
	}
	return *d.DismissalMessage
}
861656
func (c *Connection) GetMessageID(msg api.Message) (uint16, error) {
	if c == nil {
		return 0, errors.New("nil connection passed in")
	}

	if msgID, ok := c.msgIDs[getMsgNameWithCrc(msg)]; ok {
		return msgID, nil
	}

	msgID, err := c.vppClient.GetMsgID(msg.GetMessageName(), msg.GetCrcString())
	if err != nil {
		return 0, err
	}

	c.msgIDs[getMsgNameWithCrc(msg)] = msgID
	c.msgMap[msgID] = msg

	return msgID, nil
}
1139016
func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (int32, error) {
	return int32(0), NewError(E_NOTIMPL)
}
806591
func (sc *StatementContext) GetMessage() string {
	sc.mu.Lock()
	msg := sc.mu.message
	sc.mu.Unlock()
	return msg
}
1008095
func (m *Message) GetBody(section *BodySectionName) Literal {
	section = section.resp()

	for s, body := range m.Body {
		if section.Equal(s) {
			return body
		}
	}
	return nil
}
988594
func convertMessage(data interface{}) (string, error) {
	switch data.(type) {
	case string:
		return data.(string), nil
	}

	// An unexpected type. We'll get the type name for the error, but this
	// will fail the export.. so it only uses reflect once.
	name := reflect.TypeOf(data)
	return "", &UnknownElasticStructError{fmt.Sprintf("%v", name), "message"}
}
822372
func (l *Logger) NewMessage() *Message {
	msg := newMessage()
	msg.logger = l
	msg.Hostname = l.client.hostname
	return msg
}
664812
func DeserializeMessage(data []byte) (*Message, error) {
	serializable := new(SerializedMessage)
	if err := proto.Unmarshal(data, serializable); err != nil {
		return nil, err
	}

	msg := &Message{
		streamID:     MessageStreamID(serializable.GetStreamID()),
		prevStreamID: MessageStreamID(serializable.GetPrevStreamID()),
		origStreamID: MessageStreamID(serializable.GetOrigStreamID()),
		timestamp:    serializable.GetTimestamp(),
	}

	if msgData := serializable.GetData(); msgData != nil {
		msg.data.payload = msgData.GetData()
		msg.data.metadata = msgData.GetMetadata()
	}

	if msgOrigData := serializable.GetOriginal(); msgOrigData != nil {
		msg.orig = new(MessageData)
		msg.orig.payload = msgOrigData.GetData()
		msg.orig.metadata = msgOrigData.GetMetadata()
	}

	return msg, nil
}
342281
func getUIMsgs(ctx context.Context, g *globals.Context, convID chat1.ConversationID,
	uid gregor1.UID, msgs []chat1.MessageUnboxed) (uiMsgs []chat1.UIMessage) {
	for i := len(msgs) - 1; i >= 0; i-- {
		msg := msgs[i]
		uiMsg := utils.PresentMessageUnboxed(ctx, g, msg, uid, convID)
		uiMsgs = append(uiMsgs, uiMsg)
	}
	return uiMsgs
}