Quickblox - delete messages - how well deleted we can expect messages to be? - quickblox

What is the deletion policy regarding deleted messages? Are they actually deleted and lost forever or the deletion is a logic mark but the message still exists in the quickblox db?

When you delete a message then it will be deleted only for you but stay for other users in chat.
When each user in chat deleted it then it will be completely removed.
But there is a 'force' logic - an owner of chat message (sender) can delete it completely via 'force=1' flag.
http://quickblox.com/developers/Chat#Delete_message

Related

How to delete a Telegram-bot user from db, when user delete the chat of the bot

I am programming telegram-bot on Python, using aiogram and I need to delete user from database, when he delete the chat of the bot. I know that bot must receive some update, after user delete the chat of the bot. But my bot doesn't receive nothing messages about it. I tried sending a message to the user who deleted the bot hoping to get an error and then process it and remove the user from the database but the messages are still sent without error. Also I read about method sendChatAction, that can solve it, but I didn't find good examples with it. Any idea? P.S. I don't need advice how to delete user from database, I want to know how to get errors with info that user deleted the chat of the bot, that I can process(exception handling)
You can use the Update.my_chat_member updates. Those will tell you when a user blocks your bot. Note that your bot does not get notified if the user simply clears the chat history or deletes the chat with your bot without blocking the bot.
Maybe it will help someone. I use Flask-SQLAlchemy for working with database and aiogram for bot-development. Make sure that you import this "from aiogram.utils.exceptions import BotBlocked" for handling exception about blocking bot by user.
from bot_files.models import db, Users
from aiogram.utils.exceptions import BotBlocked
async def technical_works(bot):
users = Users.query.all()
for user in users:
try:
await bot.send_chat_action(user.telegram_id, action="typing")
except BotBlocked as exception_info:
db.session.delete(user)
print("User is deleted")
db.session.commit()

handle deleted message by user in telegram bot

Is there any way that can handle deleted message by user in one-to-one chat or groups that bot is member of it ?
there is method for edited message update but not for deleted message .
No. There is no way to track whether messages have been deleted or not.
The pyrogram have DeletedMessagesHandler / #Client.on_deleted_messages(). If used as Userbot, It handles in all chat groups channels. I failed to filter. Maybe it will work in a bot

RabbitMQ - how to avoid to receive own messages

I am creating a service (accessible via web and app) where users belong to a team. Whenever a user does something, all the other online users (*) in his/her team must be notified. I am evaluating RabbitMQ for this.
(*) Note that it is possible that the same user has multiple sessions at the same time: he could be logged in in different browsers at the same time, or more likely in the browser and and app at the same time.
My current approach is to create a topic exchange for each team:
When a user logs in, an auto-delete queue is created and bound to the exchange of his/her team.
When a user did an update, the backend sends a message to the exchange of the corresponding team.
Finally, all active queues - that is, all active sessions - receive the update message.
This is great, because the update message must only be sent once by the backend. However, the problem here is that the initiator also receives his own update. I would like to avoid that. Is that possible? Or should I have another design?
Ofcourse, I can always add the user identifier of the initiator in the payload of the update message and filter on that field when receiving an update message, but the message is still received.
That is an interesting question. After thinking about this for a while with this particular design, when the user wants to get the update and also make some changes while others should know about it I feel like you need to think of some other design.
With Topic as an Exchange you will always get the notification as the queue is created when you logged into the system. And Topic will broadcast it.
The topic is more for a subscription kind of thing where you can not specify easily where you want to skip one subscription or not.
One design I can think of which is bit complicated is as follow:
Create one Topic Exchange per person in the team.
When another User logs in he will subscribe to the Exchange of all other team members.
When a user makes an update it is sent to his own Exchange where all others are listening.
That way the user will not get his own update as he is listening to others topics.

Administration of telegram channel

I get into a problem with the Telegram channel,
one person creates a channel and adds other administrators to it,
then she removed her telegram. and now it is needed to add another telegram administrator to that channel.
As I understand, the only channel creator can add a new admin of the channel.
So.. what should I do?
I think even she(channel creator) reinstalls her telegram, she can't add a new admin to the channel...
if someone deletes their telegram account then bots they created are deleted, and groups or channels lose their master and no one gets the master card
https://telegram.wiki/privacy/accountdeletion
What happens after account deletion?
User will get automatically logged out of their Telegram clients.
Username and the phone number of a deleted account immediately become available to reuse.
If the user recreates the Telegram account with the same phone number, the TQ will change.
The account will have the same phone number but will be a fresh new account with a different unique ID (#tq number).
TDesktop (Windows) will still show the old account's display name, even after restarting the client. The name does not change to DELETED / Unknown / Hidden Name, etc. This is at least if you had a previous chat history with the old deleted account. If you re log in, the name will show as blank (no name at all). Other Telegram clients may display deleted accounts as DELETED / Unknown / Hidden Name, depending on the client and language/translation strings.
User's last seen will display as “Last seen a long time ago” in modern clients (“offline” in very old clients)
You can still type to a deleted account, but the messages will never be received by the Telegram servers. They will always show a clock icon, instead of 1 check.
Bots created from a deleted account are deleted too and their usernames become available to reuse.
Groups and channels aren't deleted and stay orphaned (no one gets privileges of the creator).
update: I'm a quite sure telegram was updated so that if an admin leaves a group or channel (by manually leaving or deleting their account) then the user who was connected for the longest gets the admin control... (bots still lose their admin and become useless)
(I couldn't quickly find the source for this, quite sure it was in one of the update telegraphs they sent when the change happened)
Telegram doesn't work like that. It is completely on the cloud. This means that if she reinstalls her Telegram app, it will be as if she hasn't uninstalled it. (Uninstalling is different from removing your account)

Reactivate a terminated Lync conversation with the Lync API

Using the Lync API with UI Suppression Mode enabled, is it possible to reactivate a one-on-one conversation that has been terminated? In my app, currently, if a user tries to send a message when the conversation state is terminated, I create a new conversation and invite the other user into it. It would be nice if there was a simple way to just reactivate the conversation that was terminated.
Once a conversation is terminated, AFAIK, it's terminated for ever: you can never re-create it.
However, if your application was keeping track of conversations and storing information about them as they terminated, then you could perform this functionality yourself. If a user sends a message and you know of an existing conversation with this user which has since been terminated, you could show the terminated conversation information, whilst connecting the user to the new conversation. To the users of your application it will look like the conversation was never terminated.