# place.stream.chat.defs

- Kind: defs
- Authority: chat.stream.place
- Lexicon: 1
- Published by [stream.place](https://lexicon.garden/identity/did:plc:rbvrr34edl5ddpuwcubjiost), not the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.chat.defs)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.chat.defs/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:rbvrr34edl5ddpuwcubjiost/place.stream.chat.defs/analytics)

## #messageView (`place.stream.chat.defs#messageView`)

Type: object

### Properties

- `author` (ref, required)
  - Reference: `app.bsky.actor.defs#profileViewBasic`
- `badges` (array): Up to 3 badge tokens to display with the message. First badge is server-controlled, remaining badges are user-settable. Tokens are looked up in badges.json for display info.
  - Constraints: maxLength: 3
  - `items` (ref)
    - Reference: `place.stream.badge.defs#badgeView`
- `chatProfile` (ref)
  - Reference: `place.stream.chat.profile`
- `cid` (string · cid, required)
- `deleted` (boolean): If true, this message has been deleted or labeled and should be cleared from the cache
- `indexedAt` (string · datetime, required)
- `record` (unknown, required)
- `replyTo` (union)
  - One of: `#messageView`
- `uri` (string · at-uri, required)

## #pinnedRecordView (`place.stream.chat.defs#pinnedRecordView`)

Type: object

View of a pinned chat record with hydrated message data.

### Properties

- `cid` (string · cid, required)
- `indexedAt` (string · datetime, required)
- `message` (ref)
  - Reference: `#messageView`
- `pinnedBy` (ref)
  - Reference: `place.stream.chat.profile`
- `record` (ref, required)
  - Reference: `place.stream.chat.pinnedRecord`
- `uri` (string · at-uri, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "messageView": {
      "properties": {
        "author": {
          "ref": "app.bsky.actor.defs#profileViewBasic",
          "type": "ref"
        },
        "badges": {
          "description": "Up to 3 badge tokens to display with the message. First badge is server-controlled, remaining badges are user-settable. Tokens are looked up in badges.json for display info.",
          "items": {
            "ref": "place.stream.badge.defs#badgeView",
            "type": "ref"
          },
          "maxLength": 3,
          "type": "array"
        },
        "chatProfile": {
          "ref": "place.stream.chat.profile",
          "type": "ref"
        },
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "deleted": {
          "description": "If true, this message has been deleted or labeled and should be cleared from the cache",
          "type": "boolean"
        },
        "indexedAt": {
          "format": "datetime",
          "type": "string"
        },
        "record": {
          "type": "unknown"
        },
        "replyTo": {
          "refs": [
            "#messageView"
          ],
          "type": "union"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "cid",
        "author",
        "record",
        "indexedAt"
      ],
      "type": "object"
    },
    "pinnedRecordView": {
      "description": "View of a pinned chat record with hydrated message data.",
      "properties": {
        "cid": {
          "format": "cid",
          "type": "string"
        },
        "indexedAt": {
          "format": "datetime",
          "type": "string"
        },
        "message": {
          "ref": "#messageView",
          "type": "ref"
        },
        "pinnedBy": {
          "ref": "place.stream.chat.profile",
          "type": "ref"
        },
        "record": {
          "ref": "place.stream.chat.pinnedRecord",
          "type": "ref"
        },
        "uri": {
          "format": "at-uri",
          "type": "string"
        }
      },
      "required": [
        "uri",
        "cid",
        "record",
        "indexedAt"
      ],
      "type": "object"
    }
  },
  "id": "place.stream.chat.defs",
  "lexicon": 1
}
```
