-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Pin xoxo unpin #166
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
Pin xoxo unpin #166
Conversation
Merge To Updated Version
- chat.pin() to pin - chat.unpin() to unpin
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.
Pinning/unpinning seems to work, but the return value isn't as expected (docstrings indicate it returns a boolean with the pin state). While testing I found pinning/unpinning returns a number that seems like it may be a timestamp, and I even got undefined
at one point. Can you verify this?
- Now return Booleans.
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.
The return still doesn't seem to be working right. When I first pin a chat I get false
, and unpinning gives me true
, which would seem backwards.
Calling pin()
or unpin()
more than once should also be limited or simply ignored. Doing this more than once seems to bug it out and it can get to a state where trying to unpin gives the message "Couldn't unpin chat", and just stays stuck until a restart of whatsapp web. Furthermore, doing this reverts the return values, causing pin()
to return true
and unpin()
to return false
.
Ok. Will add a check later. So the state is checked before it tries to pin/unpin. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@aliyss have you been able to take a look at this? Still seems like the pin state isn't too reliable |
@pedroslopez I didn't get to it. Very Sorry. Currently a lot to do. I'll try to look into it tomorrow. Also thanks for the mute/unmute |
- Added Check for already pinned / unpinned. - Added Check for already max amount pinned. - returns true / false based on checks instead of WhatsApp, since Whatsapp needs time to update the value.
- Checks are made in correct order
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@aliyss I think it's ok to assume it's 3 as long as we clearly indicate what that number means (e.g However, we still need to get the current number of pinned chats and compare it to prevent the issue. |
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.
Just a couple details with await
usage
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
Fixed and tested. Still works. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@pedroslopez |
* Added Pinning - chat.pin() to pin - chat.unpin() to unpin Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
* Added Pinning - chat.pin() to pin - chat.unpin() to unpin Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
chat.pin()
chat.unpin()
client.pinChat(chatId)
...