mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 18:57:20 -05:00
Add `target_user_ids` as an alternative to `target_usernames` when creating private messages via PostCreator and TopicCreator. The two options are mutually exclusive and raise ArgumentError if both are provided. This avoids username-based lookups where the caller already has user IDs, and prevents stale references when users rename after a pending PM is created. Key changes: - PostCreator/TopicCreator: accept `target_user_ids`, validate mutual exclusivity with `target_usernames`, extract shared `add_users_from_scope` in TopicCreator - Automation PendingPm: migrate from `sender`/`target_usernames` string columns to `sender_id`/`target_user_ids` integer columns with a backfill migration - Scriptable::Utils.send_pm: resolve sender upfront, support integer sender param, store IDs in pending PMs