• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 SMF to XenForo > PM to Conversations

#1
I'm about to convert my SMF board to XenForo. After a lot of testing and tweaking we are almost ready for the big step.
There is just one thing that bugs me. The PM's in SMF are converted, but they are not visible as conversations.

For example, if I would sent a PM in SMF to a user, and that user replies, this is shown as a conversation/discussion in SMF.
The two PM's belong together.

After the conversion, these PM's are separated into 2 conversations in XenForo. The importer seems to treat every PM as a separate conversation.

Is this a limitation of the converter, or would this be to difficult to accomplish?
 
#3
I asked support about it. This is just not implemented.
Currently,the conversations import from SMF is kinda basic and limited.

It only imports the PM's a user has received. PM's a user has send (outbox) are ignored, as well as PM's from deleted users.

They have fixed most of the things right now, and are now working on a solution to keep the conversation history. (y)
That would really be a seamless conversion from SMF to XF.
 
#4
Yes the imported conversations with only the received messages is confusing - it is like eavesdropping on a telephone call where you only hear one side of the conversation.

It would appear as though the SMF Importer just needs to take into consideration the value in the column 'smf_personal_messages.id_pm_head' and merge any messages with an identical number into the one private conversation.

Did support give you any indication of when SMF conversation improvements would be released, even in beta phase, @Mr. Jinx ? I'm almost at the point of rolling out Xenforo publicly but this imported conversation issue is a bit of a bummer. :(
 
#5
Yes, two important things about this:
  • Send PM's and PM's from/to deleted users are currently not imported. XF Support provided fixes for this (after a lot of trial and error) and pushed the fixes to the development team which will review it for a next release (maybe). No timeline or promesses. I'll share those fixes when I'm done. I'm currently in a migration :)
  • Keeping the conversation 'groups' will not be implemented because this works different in XF. There was no easy migration possible.
    Example: In SMF, user1 can start a conversation with user2. Then at some point, user1 can add user3 to the conversation. At that point, user3 cannot see the previous conversation between user1 & user2. In fact, user3 could reply to only user2 within the same conversation. In XF, all users (1, 2 and 3) will be able to see the whole conversation. If you would convert this situation, some users might see conversations they could not see in the past. This might be dangerous. Therefore I just accepted the fact we will loose the grouped conversations.

    ps: I got a very neat modified script from another user that made it possible to keep the grouped conversations, but it still has the problem described above. If you accept that risk, I can share that as well.
 
#6
Interesting info and valid concerns with privacy (who knows what goes on in PM ;)?). Perhaps some checking could be done that would only group messages with the same id_pm_head number that involve two (2) user ids, and keep any three (3) or more ids separated for privacy reasons?

Nevertheless even without the grouping at least having sent & received messages separately would be much better than the current one-sided situation. Let me know how you go :). I'm guessing the next Xenforo patch will be some time away from release and won't allow for an April migration of my forum.
 
#7
These are the fixes I received from support regarding the import of PM's.
It should fix the missing import of send PM's and PM's from/to deleted users (guests).
This worked fine for me.

XF Version 1.5.13

In library/xenforo/Importer/SMF.php

Find:
PHP:
            if (!$toUsers)
            {
                continue;
            }
Replace with:
PHP:
            if (!$toUsers AND !$pmText['id_member_from'])
            {
                continue;
            }


Find:
PHP:
            $newFromUserId = $this->_mapLookUp($mapUserIds, $pmText['id_member_from']);
            if (!$newFromUserId)
            {
                continue;
            }
Replace with:
PHP:
            $newFromUserId = $this->_mapLookUp($mapUserIds, $pmText['id_member_from']);
            if (!$newFromUserId)
            {
                $newFromUserId = 0;
                //continue;
            }


Find:
PHP:
            $unreadState = $sDb->fetchPairs('
                SELECT id_member, is_read
                FROM ' . $prefix . 'pm_recipients
                WHERE id_pm = ' . $sDb->quote($pmText['id_pm']) . '
                    AND deleted = 0
                GROUP BY id_member
            ');
Add after:
PHP:
            $deletedRecipients = $sDb->fetchPairs('
                SELECT id_member, deleted
                FROM ' . $prefix . 'pm_recipients
                WHERE id_pm = ' . $sDb->quote($pmText['id_pm']) . '
                    AND deleted = 1
                    GROUP BY id_member
                UNION
                SELECT id_member_from, deleted_by_sender
                FROM ' . $prefix . 'personal_messages
                    WHERE id_pm = ' . $sDb->quote($pmText['id_pm']) . '
                    AND deleted_by_sender = 1
                    GROUP BY id_member_from
            ');


Find:
PHP:
                else
                {
                    $lastReadDate = $pmText['msgtime'];
                    $deleted = true;
                    $isUnread = 0;
                }
Replace with:
PHP:
                else
                {
                    $lastReadDate = $pmText['msgtime'];
                    // $deleted = true;
                    $deleted = isset($deletedRecipients[$userId]) ? true : false;
                    $isUnread = 0;
                }
 
#8
These are the fixes I received from support regarding the import of PM's.
It should fix the missing import of send PM's and PM's from/to deleted users (guests).
This worked fine for me.

XF Version 1.5.13
Thanks!

I was thinking some more about the access issues with grouping conversations (where recipients can view PMs within the conversation that they weren't included in). I'm not sure about you but I generally use PMs only on a 1-to-1 basis, which means a maximum of 2 participants in a conversation. If the SMF -> Xenforo importer could group PMs into conversations only in cases where there are 2 participants, then I think this would prevent privacy issues with group PM conversations (3+ participants) while allowing some PM conversations to be grouped, limited to those that are 1-to-1 (with max 2 participants).