XF 2.2 All messages in thread marked as original poster, when creating thread with messages via api

findozor

Active member
I use rest-api xenforo to post a thread with messages from a guest user.

I assume that the messages mostly should be as answer from other guest users.

But after adding it all messages are marked as "original poster" which is inconsistent with the original logic.

I've tried mixing api keys, but it doesn't work. Most likely issue is the session. Can i change it it after thread creation, so that other users are not marked with the "op" bar?

If that's not the case, how can i avoid it? In addition сan i manage it to show op mark only for certain messages as mean as "op".
1681774612141.png
 
What criterion is used to apply the "original poster" badge?

Is it user ID?
ive got an answer from developer, and, yes it is user id

We use a very simple conditional to achieve this. I'm not sure why it would cause issues with your specific setup.


Code:
<xf:if is="$post.user_id == $thread.user_id AND property('xbThreadStarter') AND $post.post_id != $thread.first_post_id">
                <li class="tag-threadStarter"><span class="message-newIndicator message-threadStarter">{{ phrase('thread_starter') }}</span></li>
</xf:if>

It checks if the reply post user id matches the thread user id, then checks if the option is enabled, finally if it's not the first post.
 
All posts must have the same user ID then, most likely 0?

You will need a different approach to either how the posts are made via the API, or the badge add-on.
 
Top Bottom