generated from Nodarx/template
feat: add fetch message size limit
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -84,8 +84,15 @@ final class FetchOptions
|
||||
return $this->with('BODYSTRUCTURE');
|
||||
}
|
||||
|
||||
public function withBodyText(): self
|
||||
/**
|
||||
* @param int|null $limit Maximum number of octets to fetch (partial fetch `<0.limit>`), null for all
|
||||
*/
|
||||
public function withBodyText(?int $limit = null): self
|
||||
{
|
||||
if ($limit !== null && $limit > 0) {
|
||||
return $this->with(sprintf('BODY.PEEK[TEXT]<0.%d>', $limit));
|
||||
}
|
||||
|
||||
return $this->with('BODY.PEEK[TEXT]');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user