Implemented "Post as user"

Liam's add-ons
Post Macros

DragonByte Tech

Licensed
Licensed
Joined
Mar 9, 2020
Messages
5
Reaction score
3
I would like a new user group permission to control whether a macro can be posted as another user (`\XF::asVisitor(\XF\Entity\User $user, \Closure $closure);`.

Use case: Posting canned replies to bug reports in a similar fashion to XF's "Bug Bot" user.

I would be happy to contribute this feature to the add-on if you can point me to the GitHub repository it's hosted in :)
 
Hello,

We don't have a GitHub repository for any of our add-ons because we don't use GitHub :rolleyes:

This can be a good suggestion !

Regards, SyTry
 
Hello,

Where do you want us to define this, by creating a macro, in an option or other ?

Regards, CRUEL-MODZ
 
Hello,

So I found a solution which consists in adding a hidden input at the editor level, the problem is that if you refresh the page then I lose this hidden input, and if I don't have this hidden input I won't be able to post the message by another account unfortunately, if you had another solution I'm a taker.

Regards, CRUEL-MODZ
 
The easiest solution would probably be a new kind of replacement variable, like `{=+Username}`, instead of a pre-defined setting in the macro itself.

Upon submitting the post, check whether the user has permission to post as another user. If not, just remove that part from the post. If yes, look up the user name.
 
Perfect 👍

EDIT: The only thing that could improve it would be to pre-define the contents of the username field in the macro settings, since I'll want to use the same user multiple times.
 
the username field is already predefined in the macro by a: {=+Username} so in our case: {=+Test} : Screenshot
 
I just have to create the permission, and I can post the update ;)
 
Top Bottom