-
Notifications
You must be signed in to change notification settings - Fork 165
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
fix(other): gmail messages not shown #1409
base: master
Are you sure you want to change the base?
Conversation
May I add a comment? The other thing is that in the combined view, the automatic check and renewal of the xoauth2 bearer token (which is valid for 1 hour after renewal) does not take place, and this PR doesn't fix that. I made some code that seems to fix this part of it : indridieinarsson@3c74c2a |
hello @indridieinarsson, Can you push your suggestion in current PR please? |
Sorry for the late answer - I'm quite busy these days. I honestly don't know how I can push my branch into an existing PR. My code is available in it's own branch here : https://github.com/indridieinarsson/cypht/tree/issue_1402. Feel free to merge or cherry pick what you want. My code is not ready. It works, in the way that one we navigate to the combined mailbox, the oauth token is renewed if needed. However, if the site is left open for a while, all gmail messages will disappear after about an hour (unless the page is reloaded). The reason is that after an hour, the token has expired, and the code that checks and renews it is only run on page load. edit: forgot to mention @christer77 so he actually sees my message. |
663089c
to
f47a2ff
Compare
|
|
Hello - I'm trying to get this to work. But it's only a partial fix, since the combined pages refresh the message list regularly (via ajax, so without reloading the page). After 1hr, the gmail oauth bearer token becomes invalid, so we get a statuscode 400 when retreiving the gmail message list. At this point, I'm unsure what to do, as the handler modules seem to only run on page load, which isn't happening here. Could someone explain how the "handler modules" work and how I could trigger the |
@christer77 @kroky (the snooze worker goes on in the background and runs the oauth refresh. Snooze is part of the imap module, just as the oauth stuff, so should not be accidentally disabled) So, with the current master, this PR fixes it, for me at least. |
f47a2ff
to
19b55c1
Compare
19b55c1
to
56afcac
Compare
@@ -938,9 +938,11 @@ public function get_message_list($uids, $raw=false, $include_content_body = fals | |||
$x_auto_bcc = ''; | |||
$x_snoozed = ''; | |||
$count = count($vals); | |||
$head_finded = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be nit-picky but proper past tense of the verb find is found...
@@ -1035,6 +1040,27 @@ public function get_message_structure($uid) { | |||
return $struct; | |||
} | |||
|
|||
private function parseEmailBody($raw_data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function will deal with fraction of the cases as there are numerous transfer encodings, mime details and other stuff that might break here. Can you use zbateson/mail-mime-parser that is already included in Cypht - it has methods to get the first plaintext part of html part or whatever you need. If it is html part, then, maybe you need to strip tags first before trimming?
see issue
ref: RFC