News:

Wondering if this will always be free?  See why free is better.

Main Menu

Enhanced PM System

Started by dougiefresh, April 20, 2014, 04:30:16 PM

Previous topic - Next topic

SilverWings

Great, I have made those changes and I think that works now.

While doing that I found another bug and that is if I go inside some conversation with more messages (at this one which I tested last time had 9 messages) I can't delete it by clicking delete at any message or not even if I click "Delete this conversation" at the bottom. When I click the button to delete conversation I get to inbox but don't get any message. I can delete conversation by checking checkbox in inbox, but not from withing conversation.

dougiefresh

Hmmm....  Yet another bug  ::) :P  Lemme look into it.

SilverWings

Okey. ;D

I tested some more and sometimes when you have longer conversation and the last message is not from you and you click "Delete this conversation" button, only last message is removed (so that last message is then yours). Weird.

dougiefresh

This bug was caused by the display mode not being set correctly during all processing of PMs.  Here's how to fix... Find this:
Code (Find) Select
// Set the PM view to conversation mode unless admin settings allow users to select a different view:
if (empty($modSettings['eps_pm_view_switch']))
$context['display_mode'] = 2;

// Make sure the starting location is valid.

Replace with this:
Code (Replace) Select
// Make sure the starting location is valid.

Second operation: Find this:
Code (Find) Select
// Preferences...
and replace it with this:
Code (Replace) Select
// Set the PM view to conversation mode unless admin settings allow users to select a different view:
if (empty($modSettings['eps_pm_view_switch']))
{
$context['display_mode'] = 2;
unset($_GET['view']);
}

// Preferences...

What this does is moves the code to the beginning of the PM processing code.   This should solve the bug in the mod.

dougiefresh

Quote from: ExSpirit on August 06, 2014, 02:42:36 PM
Quote from: dougiefresh on August 05, 2014, 05:18:07 PM
Quote from: ExSpirit on July 30, 2014, 07:19:17 AM
This is really great mod, but I have 1 question - how can I change order of displayed messages in conversation? I would like to have newest on bottom, not on top.
Sorry about the lateness of the reply.  While in "My Messages" (from the top of the screen), go to "Change Settings".  You're looking for the "Show most recent personal messages at top." option.  Unchecking that option should get what you need....
This only changes the list of subjects (in inbox), but not conversation order (so when I read messages).
I tested the checkbox that I told you about and it changes both the list of subjects as well as the conversation order.  I can split that checkbox into two, one for the conversation order and one for the messages order, if you like.

Quote from: -Captain Ghost- on August 13, 2014, 11:32:23 AM
hello
If you are accepting requests then i want to request one thing that can you add feature like pm readed.
Let me explain you
Ex:-Suppose x has sent a pm to y and if y has red the message then the x will get notified that the pm has been opened or readed by y.

Hope you had understood my request.

Thanks
The ability to know whether your recipient has opened and/or read the PM is already present in the mod.  Just go to the "Outbox" folder to see which PMs haven't been opened/read.

Or are you wanting something on the main screen (or any screen for that matter) popping up saying the PM was opened?

SilverWings

Fantastic, I think it works great now. Messages deletes without a problem so far. :) Thank you very much for the fix.

SilverWings

Oh no, I wrote to soon. :( I found out that delete still doesn't work like ti should. Conversation deletes now but I have now tried to delete only one message from my friend, but entire conversation got deleted (instead of only that one specific message).

dougiefresh

Well, I made these changes to my local copy and it works fine, both convo delete and individual PM delete....  Did you do both steps I told you to do?  Have you done any other modifications to the PersonalMessage.php file?

SilverWings

#68
I have done both steps and I don't have any other modification.

Looks like a bit "random" problem, because sometimes messages are deleted, but sometimes not, I can't find out why and when. The closest thing which I came to now is send someone a message, and then he should return 2 messages and then reply back and then delete both his messages - on second attempt entire conversation will be deleted. But it's not always like that, sometimes 3 messages are enough and only last one or first one is deleted and entire conversation is removed. But I don't know when, because it's not all the time.

SilverWings

Another big problem which I discovered now:

If I am in my inbox and before I click on some new message if other person sends another new message in that conversation and after that I click on link to open conversation (without refreshing page) I get error (not enough rights), so I have to go back to inbox and click the link again. The problem is that when new message arrives in conversation, pmid changes in URL, so old one no longer works.

dougiefresh

Lemme see if I can reproduce this issue....  If I can, I'll fix it....

SilverWings

OK. If you still won't be able to reproduce this issue let me know I'll write a bit more details how to do it.

I found another bug and this is if I quote myself in conversation, then button for reply (on the end of conversation) no longer works as it should, because when I click it page for sending messages is opened but recipient is not selected.

dougiefresh

#72
Quote from: SilverWings on August 22, 2014, 02:27:18 AM
OK. If you still won't be able to reproduce this issue let me know I'll write a bit more details how to do it.
I just worked a 11 hour shift in 90+ degree heat, so I'm feeling kinda wore out.  If you wouldn't mind, can you outline how to reproduce the issue that you're seeing so that I can work on it some without having to figure out for myself how to reproduce it?  I appreciate the assistance!  Thanks!

dougiefresh

#73
Quote from: SilverWings on August 21, 2014, 03:11:02 PM
Oh no, I wrote to soon. :( I found out that delete still doesn't work like ti should. Conversation deletes now but I have now tried to delete only one message from my friend, but entire conversation got deleted (instead of only that one specific message).
I stared at the code some today and figured out where it is probably happening. 

First: In PersonalMessage.php, look for this:
Code (Find) Select
if ($folder == 'sent' || $folder === null)
and replace it with this:
Code (Replace) Select
if ($folder == 'sent' || $folder == 'unread' || $folder === null)


Second: Find this:
Code (Find) Select
if ($folder != 'sent' || $folder === null)
and replace it with this:
Code (Replace) Select
if (($folder != 'sent' && $folder != 'unread') || $folder === null)


Third: Find this:
Code (Find) Select
deleteMessages(null, $_REQUEST['f'] != 'sent' ? 'inbox' : 'sent');
and replace it with this:
Code (Replace) Select
deleteMessages(null, $_REQUEST['f'] != 'sent' ? ($_REQUEST['f'] != 'unread' ? 'inbox' : 'unread') : 'sent');

This should stop entire conversations from disappearing from the your PM box when you are trying to delete a message from the Outbox folder....

EDIT: Updated to include 3rd operation.
EDIT2: Fixed 1st operation so that it sees the Outbox correctly....

dougiefresh

#74
Quote from: SilverWings on August 22, 2014, 02:27:18 AM
I found another bug and this is if I quote myself in conversation, then button for reply (on the end of conversation) no longer works as it should, because when I click it page for sending messages is opened but recipient is not selected.
Yup, I can confirm that this is a bug within the SMF software, not specifically my mod though.  If another user quotes you, the recipient is filled in.  If you quote yourself, it is not....  This happens whether or not my mod is installed.  I'm not sure how to resolve this...

EDIT: I figured out how to resolve this.  My inspiration came from the A "Quote to All" in PM Conversation mode? thread. 

dougiefresh

#75
Uploaded v2.1 - August 24th, 2014
o Fixed a bug where a PM message is read by the user and still marked NEW, reported by ExSpirit
o Fixed a bug where user info is not updated when sent a new PM, reported by ExSpirit
o Fixed a bug where the PM display mode not being set to conversation correctly, reported by SilverWings
o Fixed a bug where PMs deleted from Outbox are incorrectly deleted, reported by SilverWings
o Added option to allow muted members the ability to send PMs.  Thanks, Corelogik!
o Added option to allow members to not block Admin PMs within the rules.  Thanks, danielwmoore!

EDIT: Fixed typo indicating members didn't have the ability to block Admin PMs with the PM rules.  This update allows admin to block the ability to create rules that include the entire Admin group.  Existing rules aren't modified.

EDIT2: The "Quote to All" functionality was stripped out of v2.1 because of improper placement.....

SilverWings

Great, I will test those changes in next days (I am currently out of town with bad WiFi connection).

What I see from now this one hasn't been solved yet, right?
Quote from: SilverWings on August 21, 2014, 03:51:44 PM
Another big problem which I discovered now:

If I am in my inbox and before I click on some new message if other person sends another new message in that conversation and after that I click on link to open conversation (without refreshing page) I get error (not enough rights), so I have to go back to inbox and click the link again. The problem is that when new message arrives in conversation, pmid changes in URL, so old one no longer works.

Quote from: dougiefresh on August 24, 2014, 01:16:52 PM
Quote from: SilverWings on August 22, 2014, 02:27:18 AM
I found another bug and this is if I quote myself in conversation, then button for reply (on the end of conversation) no longer works as it should, because when I click it page for sending messages is opened but recipient is not selected.
Yup, I can confirm that this is a bug within the SMF software, not specifically my mod though.  If another user quotes you, the recipient is filled in.  If you quote yourself, it is not....  This happens whether or not my mod is installed.  I'm not sure how to resolve this...

EDIT: I figured out how to resolve this.  My inspiration came from the A "Quote to All" in PM Conversation mode? thread.
Can you write how to solve this problem (what to change)?

dougiefresh

Quote from: SilverWings on August 25, 2014, 12:42:57 PM
What I see from now this one hasn't been solved yet, right?
Quote from: SilverWings on August 21, 2014, 03:51:44 PM
Another big problem which I discovered now:

If I am in my inbox and before I click on some new message if other person sends another new message in that conversation and after that I click on link to open conversation (without refreshing page) I get error (not enough rights), so I have to go back to inbox and click the link again. The problem is that when new message arrives in conversation, pmid changes in URL, so old one no longer works.
Honestly, I don't know because I forgot to research that issue.  I think one of the other fixes might have solved the bug you mentioned in the quotes, but I'm not sure.

Quote from: SilverWings on August 25, 2014, 12:42:57 PM
Quote from: dougiefresh on August 24, 2014, 01:16:52 PM
Quote from: SilverWings on August 22, 2014, 02:27:18 AM
I found another bug and this is if I quote myself in conversation, then button for reply (on the end of conversation) no longer works as it should, because when I click it page for sending messages is opened but recipient is not selected.
Yup, I can confirm that this is a bug within the SMF software, not specifically my mod though.  If another user quotes you, the recipient is filled in.  If you quote yourself, it is not....  This happens whether or not my mod is installed.  I'm not sure how to resolve this...

EDIT: I figured out how to resolve this.  My inspiration came from the A "Quote to All" in PM Conversation mode? thread.
Can you write how to solve this problem (what to change)?
In Themes/default/PersonalMessage.php, find this:
Code (Find) Select
<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '">', $txt['quote'], '</a></li>';
and replace it with it:
Code (Replace) Select
<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '">', $txt['quote'], '</a></li>
<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $txt['quote_to_all'], '</a></li>';

SilverWings

Should I replace it with this as you wrote:

Quote<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '">', $txt['quote'], '</a></li>
               <li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $txt['quote_to_all'], '</a></li>';

Or you copied the first line again by mistake and should be replaced like this:

Quote<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $txt['quote_to_all'], '</a></li>';


I managed to make all modification which you wrote, but the bug with URL still exists, so those changes don't fix it. I have now installed latest mod version on clean SMF and tested if this is fixed (so that if it was I would compare files and see the changes), but this problem still exists even with latest version 2.1:

If I am in my inbox and before I click on some conversation if other person sends another new message in that conversation and after that I click on link to open conversation (without refreshing page) I get error "You are not allowed to access this section", so I have to go back to inbox and click the link again. The problem is that when new message arrives in conversation, pmid changes in URL, so old one no longer works.

dougiefresh

Quote from: SilverWings on August 27, 2014, 02:06:42 AM
Should I replace it with this as you wrote:

Quote<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '">', $txt['quote'], '</a></li>
               <li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $txt['quote_to_all'], '</a></li>';

Or you copied the first line again by mistake and should be replaced like this:

Quote<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=all">', $txt['quote_to_all'], '</a></li>';
Either one should work, however, if you just add the line beneath the existing one, make sure you move the quotes and semicolon so that you don't get errors when you try to use it.

Quote from: SilverWings on August 27, 2014, 02:06:42 AM
I managed to make all modification which you wrote, but the bug with URL still exists, so those changes don't fix it. I have now installed latest mod version on clean SMF and tested if this is fixed (so that if it was I would compare files and see the changes), but this problem still exists even with latest version 2.1:

If I am in my inbox and before I click on some conversation if other person sends another new message in that conversation and after that I click on link to open conversation (without refreshing page) I get error "You are not allowed to access this section", so I have to go back to inbox and click the link again. The problem is that when new message arrives in conversation, pmid changes in URL, so old one no longer works.
Okay.  Lemme investigate this issue.

Advertisement: