# PM replies have wrong archetype

**URL:** https://meta.discourse.org/t/pm-replies-have-wrong-archetype/51508
**Category:** Bug
**Tags:** pr-welcome
**Created:** [October 13, 2016, 5:16pm UTC](https://meta.discourse.org/t/pm-replies-have-wrong-archetype/51508 "2016-10-13T17:16:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tim.smith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tim.smith/32/119954_2.png) [@tim.smith](https://meta.discourse.org/u/tim.smith)
#### Post date: [October 13, 2016, 5:16pm UTC](https://meta.discourse.org/t/pm-replies-have-wrong-archetype/51508/1 "2016-10-13T17:16:51Z")

</div>

When replying to a PM, the UI sends the POST request to discourse and specifies `archetype=general` in the form data. It should be specifying `archetype=private_message`.

This causes an issue with server-side plugins using `DiscourseEvent.on(:post_created)`. When inspecting the topic data, the archetype is specified as whatever value was provided by the UI. This means that the plugin will receive an archetype of “general” instead of “private\_message” and therefore cannot distinguish between the two.

Additionally, _literally_ any value can be specified by the UI; it is not checked server side. This means that not only is the value for PM replies incorrect, but that the value can’t be trusted to be accurate because it’s an unchecked value from the client.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 22, 2016, 4:38am UTC](https://meta.discourse.org/t/pm-replies-have-wrong-archetype/51508/2 "2016-11-22T04:38:13Z")

</div>

Thing is “replies” have no archetype, the archetype is at the topic level.

Discourse Event should be either shipping nothing or the topic over.
