Skip to content

get statuses in client#357

Open
hossinasaadi wants to merge 7 commits into
sigalor:masterfrom
hossinasaadi:f1
Open

get statuses in client#357
hossinasaadi wants to merge 7 commits into
sigalor:masterfrom
hossinasaadi:f1

Conversation

@hossinasaadi
Copy link
Copy Markdown
Contributor

  • add statuses response to client

Screen Shot 2022-02-11 at 6 28 07 PM

  • add sorted contacts

Screen Shot 2022-02-11 at 6 25 33 PM

  • update Whatsapp Web version to 2,2136,10

@hossinasaadi
Copy link
Copy Markdown
Contributor Author

Hi, @quad , @sigalor please check this out

@hossinasaadi
Copy link
Copy Markdown
Contributor Author

I’m working on listing statuses in client on new branch, so need this to merge @quad :D

Screen.Recording.2022-02-12.at.6.41.1.mov

@OmerFI
Copy link
Copy Markdown
Contributor

OmerFI commented Feb 26, 2022

Why do you use camel case? In Python, the convention is snake case.

@hossinasaadi
Copy link
Copy Markdown
Contributor Author

Hi @OmerFI , actually I’m following project structure :)

Comment thread backend/whatsapp.py
Comment on lines +186 to +198
try:
if processedData[1]['type'] is "contacts":
messageType = "jsonContacts";
processedData.append(self.sortedContacts(processedData))
except:
pass
# sort statuses
try:
if processedData[2][0][0] is "status":
processedData[2] = self.sortedStatuses(processedData)
messageType = "jsonStatuses";
except:
pass
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these exceptions caught as a result of, say, processedData[1]['type'] throwing IndexError or something?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, some responses don’t have a 'type' key, like 'action' response.
so sometimes it throws an error but try/except will handle that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these exceptions caught as a result of, say, processedData[1]['type'] throwing IndexError or something?

@quad any problem ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants