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

Write Plugins development documentation #636

Open
cfanboy opened this issue Apr 12, 2021 · 8 comments
Open

Write Plugins development documentation #636

cfanboy opened this issue Apr 12, 2021 · 8 comments

Comments

@cfanboy
Copy link

cfanboy commented Apr 12, 2021

We have a message content filter requirement, after reading through the document, we think we can use the Plugin to implement it. But cannot find any document about the Plugin, So where can find the Tinode Plugin development document?
Thanks a lot.

@or-else
Copy link
Contributor

or-else commented Apr 12, 2021

@or-else or-else changed the title Where is Plugins development documents? Write Plugins development documentation Apr 12, 2021
@or-else
Copy link
Contributor

or-else commented Apr 12, 2021

You may also look here for examples of plugins:
https://github.com/tinode/chat/tree/master/chatbot

@cfanboy
Copy link
Author

cfanboy commented Apr 13, 2021

Thanks a lot.
I made a filter message plugin. And can get the sent message content by user, but found the message received by User B, then the Plugin method will be called. Is any way to prevent the message deliver before plugin checking? If the check failed, send a note to the user, if the check pass, send the original one.
Thanks

@or-else
Copy link
Contributor

or-else commented Apr 13, 2021

All methods returning Unused are read-only. You should use FireHose: https://github.com/tinode/chat/blob/master/pbx/model.proto#L17

@cfanboy
Copy link
Author

cfanboy commented Apr 13, 2021

Sorry, maybe I did not describe it clearly. For example, UserA chat with UserB as P2P,UserA sent message "Hello, UserB“, before UserB received the 'Hello' message, I want to check the message content. If it matches some rule, then UserB receives the message, or else a note will send to UserB.
But for now, when the UserB received the message 'Hello, UserB', then the Plugin method(FireHose) will be called. Is any way to hold the message first by checking and then deliver it?
Thanks

@or-else
Copy link
Contributor

or-else commented Apr 13, 2021

I understood your question and I gave you the answer which I believe is giving you the path to get exactly what you want.

This discussion is unrelated to your feature request. Please use the forum for further questions.

@cfanboy
Copy link
Author

cfanboy commented Apr 14, 2021

it's done, thanks

@mohofo7
Copy link

mohofo7 commented Sep 28, 2022

@cfanboy can you address or make your plugin public?

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

No branches or pull requests

3 participants