Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shouldn't setMsgn actually be called setSequenceNumber? #222

Open
HelloSebastian opened this issue Mar 31, 2022 · 1 comment
Open

Shouldn't setMsgn actually be called setSequenceNumber? #222

HelloSebastian opened this issue Mar 31, 2022 · 1 comment
Labels
enhancement New feature or request validated

Comments

@HelloSebastian
Copy link
Contributor

Hi @Webklex,

I am confused by the naming of setMsgn or also getMesgn. In the method the position of a message inside the mailbox is set. According to the name in RFC 3501 this number is called "sequence number".

Is there a background why the method was named like this?

As mentioned in #219 (comment), I would like to make this call for getUID "lazy". This will save us from building the uid_cache. This could then be done directly with the name change.

I'm excited to hear your thoughts on this :)

php-imap/src/Message.php

Lines 1380 to 1395 in 6e76b35

/**
* Set the message number
* @param int $msgn
* @param int|null $msglist
*
* @return $this
* @throws Exceptions\MessageNotFoundException
* @throws Exceptions\ConnectionFailedException
*/
public function setMsgn(int $msgn, int $msglist = null): Message {
$this->msgn = $msgn;
$this->msglist = $msglist;
$this->uid = $this->client->getConnection()->getUid($this->msgn);
return $this;
}

@Webklex Webklex added enhancement New feature or request validated labels Aug 8, 2022
@Webklex
Copy link
Owner

Webklex commented Aug 8, 2022

Hi @HelloSebastian ,
you are absolutely right! Many thanks for the hint :)

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request validated
Projects
None yet
Development

No branches or pull requests

2 participants