In group chat notify inviter about packet rejection - block

I have developed a openfire plugin (Openfire version is 3.6.4) to monitor flow of packets among users, which can restrict 2 users from chat if Admin has done so, it is working fine in peer chat in case like if there are 2 users user1 & user2, admin wants user1 should not do peer chat with user2 in this case it works fine and user1 get a message "not allowed" (customized message) if he tries to chat with user2 (I throw packet rejection exception in code to notify sender).
Now admin wants that user1 should not start group chat with user2 also works (user2 do not get chatroom invitation) but inviter do not get any response saying "not allowed" (like case in peer chat), so can anyone suggest me how can I notify the inviter by sending him message.
I have checked Admin usecases for Group chat in xmpp RFC 0045 (http://xmpp.org/extensions/xep-0045.html#ban) which has Admin usecase to ban a user from group chat, can anyone suggest how can I use this RFC packet to notfy inviter.

Related

KeyCloak : Disable account after 5 incorrect login attempts, and send an email to the user to reactivate the account

I'm working on a project with KeyCloak where the requirement is after 5 incorrect login attempts from the user, the account needs to be suspended, and an email should be sent to the user to reactivate the account
So far I couldn't find this configuration, can you please tell me if it's possible? And if yes, where the option is?

/setprivacy is not working with my Telegram bot

In the process of adding Telegram bot to a group, the /setprivacy is set to Enable, so that whenever the user mention the bot using the username of bot or '/', the bot will get the message. Despite of this enable setting, the bot still receives the query from the user and replying to it.
More info:-
I set the bot as a Administrator of that group to access message
/setprivacy status Enabled (I tried switching it to Disabled and Enable it again, not working)
Anyone please help me on this issue.
Thanks
A bot set as administrator will always receive all messages, no matter the privacy setting. See https://core.telegram.org/bots#privacy-mode.
Privacy mode is enabled by default for all bots, except bots that were
added to the group as admins (bot admins always receive all messages).
You need to either revoke your bot's admin status or program your bot not to reply to a user's query.

Getting Unauthorized on Create ChatMessage even though Application has Teamwork.Migrate.All permission (BETA)

I'm using the /beta endpoints for Microsoft Graph API, but I'm getting an Unauthorized error when trying to create chat messages on behalf of other users (or any user).
In v1.0 of the API, the Create chatMessage method is not Supported, but in Beta it is: https://learn.microsoft.com/en-us/graph/api/channel-post-message?view=graph-rest-beta&tabs=http, as "Teamwork.Migrate.All" permission, which my Application has in Azure.
It is strange, because the same App can create Teams, channels and add members, but not add channel messages.
Anyone know where to look next?
Edit: I got this back now: "You need to add user delegated permissions in your application to at least Group.ReadWrite.All in portal.azure.com and then consent as user or Grant admin consent in portal. And re-run On behalf of a User | Get User Access Token request to update access token."
However, it does not make sense in regards to what the Beta documentation says about the permission "Teamwork.Migrate.All", which my app has as an "Application Permission": "Allows the app to create chat and channel messages, without a signed in user. The app specifies which user appears as the sender, and can backdate the message to appear as if it was sent long ago. The messages can be sent to any chat or channel in the organization."
If I'm an app and I have that permission, what should I do with a User Access Token? I'm using the App Access Token.
For simply posting message to Teams Channel using Application Permission is not supported by Microsoft Graph
Alternatively you can setup Incoming Webhook which is connector in MsTeams's channel and after finish set up on Teams channel you will received URL which you could use Postman or any API consumer app to send request(your message) to Incoming Webhook which will be post in Teams Channel
Sample Result Image
NOTE: Incoming Webhook is not support for replying post
You need to add user delegated permissions in your application to at
least Group.ReadWrite.All in portal.azure.com and then consent as user
or Grant admin consent in portal. And re-run On behalf of a User | Get
User Access Token request to update access token.
It seems that you need to use a user token instead of an application token to create chat messages. The only difference between them is that the user token requires the user to log in. The application token allows the application to create chat messages on behalf of other users. Currently, you can only use user tokens.
As your prompt message says, you need to grant the Group.ReadWrite.All delegation permission to the application, and then grant the admin consent for the permission, and then you need to use the auth code flow to obtain the access token.
Update:
I think what you are doing is importing messages, not creating chat messages, it does require you to have the Teamwork.Migrate.All application permission.
Importing messages is special, it requires you to create team and create achannel in the migration state, you need to include the migration value in the teamCreationMode and channelCreationMode instance attributes in the POST request. See: here.

Salesforce Streaming API Handshake denied

I am using streaming api and cometD in community.
It works fine for authorized users but still doesnt work for Guest user. For example, in anonymous window. And every time i receve Handshake denied w/ error '401::Authentication invalid'.
What's the problem exactly? But if i log in anonymous window to org then it works.
Perhaps you will be using {!$Api.Session_ID} which will return null in the case of Salesforce Guest user.
Because Guest User doesn't have a session id to access salesforce streaming API.
You need to authenticate as a user in order to stream and subscribe to events for cometD.
If you want to stream events for guest users:
you have to spend a platform license by creating a dedicated user for it.
save the creds of a user in custom settings
generate an access token using the creds
use the access token as session-id while subscribing to platform events for guest users.
don't forget to remove the data access except for platform events.

Trigger.io doesn't expose the user's agreement to notifications in iOS

I am building a trigger.io app (ios+Android) with notifications through parse.com.
Notifications are working, but I am unable to test for whether the user has agreed to notifications before trying to subscribe to a channel with forge.parse.push.subscribe. This is generally only a problem on first run of the app.
forge.parse.installationInfo will return an info.id, even if that user hasn't agreed to notifications, so it can't be used to test for agreement:
forge.parse.push.subscribe throws an error if the user hasn't agreed to notifications:
{ "message":"Subscribing to Parse channel failed: Error Domain=Parse Code=115
\\"The operation couldn’t be completed. (Parse error 115.)
\\" UserInfo=0x165ddbc0 {code=115,
error=There is no device token stored yet.}","type":"UNEXPECTED_FAILURE"}'
I could set a timeout to try subscribing again later in case the user has since accepted notifications, but I'm not happy with having to send multiple REST requests to parse.com to see if the user has agreed to notifications.
forge.parse.registerForNotifications just delays the registration process, but doesn't throw an error if the user doesn't agree to notifications.
Trigger.io displays a console event when the user accepts:
Initializing Parse and subscribing to default channel.
Can this also expose an event to forge to be accessed in the js when the user agrees to notifications?
Or should forge.parse.installationInfo throw an error if the user doesn't have notifications on?