// ShowSimpleMessageBox displays a simple modal message box.
// (https://wiki.libsdl.org/SDL_ShowSimpleMessageBox)
426618
func ShowSimpleMessageBox(flags uint32, title, message string, window *Window) error {
	_title := C.CString(title)
	defer C.free(unsafe.Pointer(_title))
	_message := C.CString(message)
	defer C.free(unsafe.Pointer(_message))
	return errorFromInt(int(
		C.SDL_ShowSimpleMessageBox(C.Uint32(flags), _title, _message, window.cptr())))
}
471215
func (service *VboxPortType) IFramebuffervideoModeSupported(request *IFramebuffervideoModeSupported) (*IFramebuffervideoModeSupportedResponse, error) {
	response := new(IFramebuffervideoModeSupportedResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
365391
func (cn *conn) sendSimpleMessage(typ byte) (err error) {
	_, err = cn.c.Write([]byte{typ, '\x00', '\x00', '\x00', '\x04'})
	return err
}
1270472
func EasyOpen(box []byte, key nacl.Key) ([]byte, error) {
	if len(box) < 24 {
		return nil, errors.New("secretbox: message too short")
	}
	decryptNonce := new([24]byte)
	copy(decryptNonce[:], box[:24])
	decrypted, ok := Open([]byte{}, box[24:], decryptNonce, key)
	if !ok {
		return nil, errInvalidInput
	}
	return decrypted, nil
}
857469
func (m *FlipManager) MaybeInjectFlipMessage(ctx context.Context, boxedMsg chat1.MessageBoxed,
	inboxVers chat1.InboxVers, uid gregor1.UID, convID chat1.ConversationID, topicType chat1.TopicType) bool {
	// earliest of outs if this isn't a dev convo, an error, or the outbox ID message
	if topicType != chat1.TopicType_DEV || boxedMsg.GetMessageType() != chat1.MessageType_FLIP ||
		m.isHostMessageInfoMsgID(boxedMsg.GetMessageID()) {
		return false
	}
	defer m.Trace(ctx, func() error { return nil }, "MaybeInjectFlipMessage: uid: %s convID: %s", uid, convID)()

	// Update inbox for this guy
	if err := m.G().InboxSource.UpdateInboxVersion(ctx, uid, inboxVers); err != nil {
		m.Debug(ctx, "MaybeInjectFlipMessage: failed to update inbox version: %s", err)
		// charge forward here, we will figure it out
	}
	if err := storage.New(m.G(), nil).SetMaxMsgID(ctx, convID, uid, boxedMsg.GetMessageID()); err != nil {
		m.Debug(ctx, "MaybeInjectFlipMessage: failed to write max msgid: %s", err)
		// charge forward from this error
	}
	// Unbox the message
	conv, err := utils.GetUnverifiedConv(ctx, m.G(), uid, convID, types.InboxSourceDataSourceAll)
	if err != nil {
		m.Debug(ctx, "MaybeInjectFlipMessage: failed to get conversation for unbox: %s", err)
		return true
	}
	msg, err := NewBoxer(m.G()).UnboxMessage(ctx, boxedMsg, conv.Conv, nil)
	if err != nil {
		m.Debug(ctx, "MaybeInjectFlipMessage: failed to unbox: %s", err)
		return true
	}
	if !msg.IsValid() {
		m.Debug(ctx, "MaybeInjectFlipMessage: failed to unbox msg")
		return true
	}
	body := msg.Valid().MessageBody
	if !body.IsType(chat1.MessageType_FLIP) {
		m.Debug(ctx, "MaybeInjectFlipMessage: bogus flip message with a non-flip body")
		return true
	}
	// Ignore anything from the current device
	ctx = globals.BackgroundChatCtx(ctx, m.G())
	select {
	case m.maybeInjectCh <- func() {
		defer m.Trace(ctx, func() error { return nil },
			"MaybeInjectFlipMessage(goroutine): uid: %s convID: %s id: %d",
			uid, convID, msg.GetMessageID())()
		if m.Me().Eq(flip.UserDevice{
			U: msg.Valid().ClientHeader.Sender,
			D: msg.Valid().ClientHeader.SenderDevice,
		}) {
			m.gameMsgIDs.Add(body.Flip().GameID.String(), msg.GetMessageID())
			return
		}
		// Check to see if we are going to participate from this inject
		hmi, err := m.getHostMessageInfo(ctx, convID)
		if err != nil {
			m.Debug(ctx, "MaybeInjectFlipMessage: failed to get host message info: %s", err)
			return
		}
		if m.shouldIgnoreInject(ctx, hmi.ConvID, convID, body.Flip().GameID) {
			m.Debug(ctx, "MaybeInjectFlipMessage: ignored flip message")
			return
		}
		// Check to see if the game is unknown, and if so, then rebuild and see what we can do
		if err := m.updateActiveGame(ctx, uid, convID, hmi.ConvID, msg, body.Flip().GameID); err != nil {
			m.Debug(ctx, "MaybeInjectFlipMessage: failed to rebuild non-active game: %s", err)
		}
	}:
	default:
		m.Debug(ctx, "MaybeInjectFlipMessage: failed to dispatch job, queue full!")
	}
	return true
}
1305307
func (c *Context) EditPressedMessageTextAndInlineKeyboard(text string, kb InlineKeyboard) error {
	if c.Callback == nil {
		return errors.New("EditPressedMessageTextAndInlineKeyboard: Callback is not presented")
	}

	return c.EditMessageTextAndInlineKeyboard(c.Callback.Message, c.Callback.Message.InlineKeyboardMarkup.State, text, kb)
}
1192146
func (service *VboxPortType) INATEnginegetAliasMode(request *INATEnginegetAliasMode) (*INATEnginegetAliasModeResponse, error) {
	response := new(INATEnginegetAliasModeResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
444260
func (c *Conversation) revealSigMessage() ([]byte, error) {
	c.calcAKEKeys(c.calcDHSharedSecret())
	c.ake.keys.ourKeyID++

	encryptedSig, err := c.generateEncryptedSignature(&c.ake.revealKey)
	if err != nil {
		return nil, err
	}

	macSig := sumHMAC(c.ake.revealKey.m2, encryptedSig, c.version)
	revealSigMsg := revealSig{
		r:            c.ake.r,
		encryptedSig: encryptedSig,
		macSig:       macSig,
	}

	return revealSigMsg.serialize(c.version), nil
}
675289
func MsgOptionMeMessage() MsgOption {
	return func(config *sendConfig) error {
		config.endpoint = config.apiurl + string(chatMeMessage)
		return nil
	}
}
489904
func (service *VboxPortType) IClipboardModeChangedEventgetClipboardMode(request *IClipboardModeChangedEventgetClipboardMode) (*IClipboardModeChangedEventgetClipboardModeResponse, error) {
	response := new(IClipboardModeChangedEventgetClipboardModeResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
900780
func Message(level string, msg string) {
	body := buildBody(level, msg)
	data := body["data"].(map[string]interface{})
	data["body"] = messageBody(msg)

	push(body)
}
1092778
func MessageWithExtrasAndContext(ctx context.Context, level string, msg string, extras map[string]interface{}) {
	std.MessageWithExtrasAndContext(ctx, level, msg, extras)
}
680446
func (service *VboxPortType) IMediumclose(request *IMediumclose) (*IMediumcloseResponse, error) {
	response := new(IMediumcloseResponse)
	err := service.client.Call("", request, response)
	if err != nil {
		return nil, err
	}

	return response, nil
}
174263
func (n Notification) Show() (id uint32, err error) {
	conn, err := dbus.SessionBus()
	if err != nil {
		return
	}

	// We need to convert the interface type of the map to dbus.Variant as
	// people dont want to have to import the dbus package just to make use
	// of the notification hints.
	hints := map[string]dbus.Variant{}
	for k, v := range n.Hints {
		hints[k] = dbus.MakeVariant(v)
	}

	obj := conn.Object(DbusInterfacePath, DbusObjectPath)
	call := obj.Call(
		CallNotify,
		0,
		n.AppName,
		n.ReplacesID,
		n.AppIcon,
		n.Summary,
		n.Body,
		n.Actions,
		hints,
		n.Timeout)
	if err = call.Err; err != nil {
		return
	}

	err = call.Store(&id)
	return
}
1262559
func (b *Boxer) verifyMessageV1(ctx context.Context, header chat1.HeaderPlaintext, msg chat1.MessageBoxed, skipBodyVerification bool) (verifyMessageRes, types.UnboxingError) {
	headerVersion, err := header.Version()
	if err != nil {
		return verifyMessageRes{}, NewPermanentUnboxingError(err)
	}

	switch headerVersion {
	case chat1.HeaderPlaintextVersion_V1:
		return b.verifyMessageHeaderV1(ctx, header.V1(), msg, skipBodyVerification)
	// NOTE: When adding new versions here, you must also update
	// chat1/extras.go so MessageUnboxedError.ParseableVersion understands the
	// new max version
	default:
		return verifyMessageRes{},
			NewPermanentUnboxingError(NewHeaderVersionError(headerVersion,
				b.headerUnsupported(ctx, headerVersion, header)))
	}
}
182208
func (v *Validator) Messages() []string {
	msgs := []string{}
	for _, vr := range v.results {
		msgs = append(msgs, vr.message)
	}
	return msgs
}
904528
func VisibleChatConversationStatuses() (res []chat1.ConversationStatus) {
	for _, s := range chat1.ConversationStatusMap {
		if GetConversationStatusBehavior(s).ShowInInbox {
			res = append(res, s)
		}
	}
	sort.Sort(byConversationStatus(res))
	return
}