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

Feats and fixed functions #1015

Merged
merged 4 commits into from May 1, 2023
Merged

Conversation

icleitoncosta
Copy link
Contributor

@icleitoncosta icleitoncosta commented Apr 1, 2023

  • Fixed group doc

  • Added event when update chat labels

  • Labels update
    Isso é uma solicitação de uma issue do server, que não existia um evento para tratar isso. A melhor função para ser usada, deveria ser a LabelStore.addOrRemoveLabels, porém a mesma, não consigo fazer um wrapper dela, portanto usei as funções subsequentes, a outra ideia seria utilizar o LabelStore.on('senderObj.labels...) (algo assim), porém as funções das etiquetas executavam diversas vezes, a alternativa sugerida seria usar um debounce, o executei, porém, ficaria confuso para o usuário da biblioteca, pois ele não saberia o que foi removido ou adicionado, já que o evento é executado apenas com o novo estado das etiquetas, avaliando essas opções, acredito que a alternativa enviada seja a melhor.

@Saifallak
Copy link
Contributor

Sorry for ping,..
But when you have time @edgardmessias review this,..
Really need it

* ```
* @category Chat
*/
export function getAllChats(options: GetAllChatsOptions = {}): ChatModel[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Dê uma olhada no WPP.chat.list, pois basicamente ele é a mesma coisa, talvez seja interessante adicionar a opção de busca lá, como o count e direction

webpack.onInjected(() => register());

function register() {
async function processLabelEvent(event: 'add' | 'remove', ...args: any) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Talvez aqui seria interessante fazer um teste com o ChatStore.on() para capturar os eventos de etiquetas.

Vou fazer mais testes para saber se existe outro ponto melhor.

@edgardmessias
Copy link
Contributor

@icleitoncosta , poderia atualizar essa solicitação e remover o getAllChats?

@icleitoncosta
Copy link
Contributor Author

@icleitoncosta , poderia atualizar essa solicitação e remover o getAllChats?

Sim, lembrei dela hje mais cedo, só vou fazer uns ajustes e atualizar

@icleitoncosta
Copy link
Contributor Author

@icleitoncosta , poderia atualizar essa solicitação e remover o getAllChats?

Pronto, removi o getAllChats, ainda preciso entender como funciona o rebase pra excluir o commit, vc ja me explicou, mas uma hora sai direito rs

@edgardmessias edgardmessias merged commit b65a518 into wppconnect-team:main May 1, 2023
16 checks passed
@icleitoncosta icleitoncosta deleted the pls branch May 1, 2023 13:43
@pedromagnox
Copy link

Alguma novidade em relação aos Labels pessoal? Muito complicado de implementar?

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.

None yet

4 participants