Get notification from Microsoft Graph when deleting event occurrence - microsoft-graph-api

I have subscribed to events (https://outlook.office.com/api/v2.0/me/events) push notification.
When I delete one event of recurrence master event, I receive UPDATED notification with id of master event and not specific occurrence event id.
How can I know which event was deleted without comparison with all previous recurrence events? And not receive only master id event.

When you "delete" and occurrence, you're technically not deleting an entity. You're actual adding an exception to the master's recurrence pattern. This is why you're receiving a notification that the master was updated rather than a notification that an event was deleted.
You can see the list of event occurrences and exceptions by calling the /instances. This will return a collection of event objects for a given master. You can determine if an object is an occurrence or an exception by looking at the type property (possible values are SingleInstance, Occurrence, Exception, or SeriesMaster).

Related

Get Status of meetings in a channel in Microsoft Teams

Given a channel-id of a channel is there any endpoint that allows us to query if there is a meeting happening in that channel at the time of the query. Irrespective of whether the meeting was scheduled before or started directly.
From what I have seen so far
GET /teams/{team-id}/channels/{channel-id}/messages
Gives the scheduled meeting, but sometimes the meeting may not have started as per time, so how do I know if there is a live meeting (i.e, a meeting has started) in a channel, given its channel-id
The response for the request
GET /teams/{team-id}/channels/{channel-id}/messages
returns collection of chatMessage.
chatMessage has a property eventDetail of eventMessageDetail resource type which represents details of an event that happened in a channel.
One of the event is callStartedEventMessageDetail which represents the details of an event message about call started. This message is generated when a call starts.
callStartedEventMessageDetail has a property callEventType which represents the call event type. Possible values are: call, meeting, screenShare, unknownFutureValue.
So check eventDetail if it contains callStartedEventMessageDetail with the property callEventType set to meeting.
Opposite to callStartedEventMessageDetail is callEndedEventMessageDetail which represents the details of an event message about an ended call
Resources:
chatMessage resource type
eventMessageDetail resource type
callStartedEventMessageDetail resource type
callEndedEventMessageDetails resource type

Firebase added/removed/changed children listener using Swift

The official Firebase Documentation states:
ChildAdded
EventHandler< ChildChangedEventArgs > ChildAdded
Event raised when children nodes are added relative to this location.
Register a handler to observe when children are added relative to this
Query object. Each time time children nodes are added, your handler
will be called with an immutable snapshot of the data.
ChildRemoved
EventHandler< ChildChangedEventArgs > ChildRemoved
Event raised when children nodes are removed relative to this
location.
Register a handler to observe when children are removed relative to
this Query object. Each time time children nodes are removed, your
handler will be called with an immutable snapshot of the data.
ChildChanged
EventHandler< ChildChangedEventArgs > ChildChanged
Event raised when children nodes are changed relative to this
location.
Register a handler to observe changes to children relative to this
Query object. Each time time children nodes are changed, your handler
will be called with an immutable snapshot of the data.
So far I am using ChildRemoved and ChildAdded successfully, and they work solidly and with no hassle for what I am doing. In particular, these two listeners are independent, that is to say: the actions that make one of them fire are guaranteed not make the other one fire. So, I do not have to do any synchronization or scheduling to resolve conflicts.
My question is: Are these three listener types independent of each other?
That is to say:
For any given action, I am guaranteed that one, and at most one, of the three listeners will fire.
Only ChildAdded fires when the listener is first established. The other two listener types do not.
A note about the documentation, it would resolved ambiguity if the documentation for the ChildChanged would specify what it means by "childChanged": does it include addition/removal/moving/editing of a child, or does it only focus on editing to an existing child?
Each one of these events is a specific way to handle synchronization of data across clients.
.childChanged
will be called whenever something changes
So if you have a real time database like the following:
/store/<random-number-inserted-by-firebase-1>/name/store-1
/store/<random-number-inserted-by-firebase-1>/location/street-1
/store/<random-number-inserted-by-firebase-1>/items/0/name/name-1
/store/<random-number-inserted-by-firebase-1>/items/0/type/type-1
/store/<random-number-inserted-by-firebase-1>/items/1/name/name-2
/store/<random-number-inserted-by-firebase-1>/items/1/type/type-2
/store/<random-number-inserted-by-firebase-2>/name/store-2
/store/<random-number-inserted-by-firebase-2>/location/street-2
You start the childAdded, childChanged, and childRemoved observers on "/store" together.
If you change /store/<random-number-inserted-by-firebase-1>/items/0/type/type-1 to /store/<random-number-inserted-by-firebase-1>/items/0/type/new-type-1 your childChanged callback function will receive a dictionary ["random-number-inserted-by-firebase-1": ["name": "store-1", "location": "street-1", "items": [["name": "name-1", "type": "new-type-1"], ["name": "name-2", "type": "type-2"]] .childAdded listens for anything that changes in a node.

ChildAdded with LimitToLast triggers ChildRemoved

Regarding Firebase documentation if you limit your query with "toLast" then when a child is added, if you already exceed the value (in my case f.e. 50) then child removed is also triggered because the first child is deleted from the scope.
The following listeners are the ones I have on the code:
firebaseReference.queryOrderedByKey().queryLimited(toLast: 50).observe(.childAdded...
firebaseReference.queryOrderedByKey().queryLimited(toLast: 50).observe(.childRemoved...
I would like to know if there is some way to differenciate when a child is really deleted or a child is just deleted from the scope.
Thank you so much,
any further information don't hestiate to ask.
Firebase does not send along information on why you're receiving the .childRemoved event, so there's no way to know it based on that.
The only thing I can quickly think of is adding a .value listener for each child, which will then fire with null when the child gets deleted.
You'll want to remove the .value listener after you receive the .childRemoved handler, to not have dangling listeners for each child you've ever seen, so this may become more work than it's worth.

TVirtualStringTree. How to identify the exact node checked by the user?

My question relates to the issue raised in
TVirtualStringTree. How to check a node and its children with a single confirmation?
If the options for propagation are enabled and the user checks an internal node, the events OnCheck and OnChecking are triggered first for its child nodes. Is there any way that the program could identify the exact node checked by the user, when event handler for OnCheck is being executed? I experimentally ascertained that the handler for OnNodeClick is triggered only after OnCheck.
There is nothing built in, you will need to do it yourself.
The OnChecking event for the clicked node seems to be the first one executed at a checkbox click. So, create a variable, say ClickedNode:PVirtualNode (normally nil). In the OnChecking event check if it is nil and if it is, set it's value to the node of the event. The last event to fire is the OnClick event, in which you reset the ClickedNode to nil. In between, in the OnChecking or OnChecked events, you know that ClickedNode triggered the checking sequence.

Custom email notifications for "Digest" type of alert subscription

I am working on a custom email notification for a WSS 3.0 solution. I am using a custom class inheriting from IAlertNotifyHandler to generate the email. There is a great example here that shows how this is done for an Immediate alert. Here is some of the code related to the SPAlertHandlerParams, which is used to get information about the alert and the item that triggered the alert.
SPAlertHandlerParams ahp;
int id = ahp.eventData[0].itemId; //gets the itemId of the item triggering the notification.
SPListItem myItem = list.GetItembyId(id);
For immediate alerts, this works great as the item I want is always at the [0] position of the eventData object. For a digest event, I thought I could just loop through all of the items in the ahp.eventData. Two problems with this.
First, it gives me all of the events where it is sending notifications, not just the ones for me. Second the eventData[0].itemId no longer points to a valid id on the list. It is 6-7 digit number instead of a 3 digit number.
Does anyone know the correct way to get to the alert information for digest emails?
Please let me know if you have any additional questions about this.
Thanks for your help!
For my project, I created a custom timer job (using the post by Andrew Connell) that mimics the Alert functionality. It runs overnight and queries for any users subscribed to my list with daily alerts. It then packages all of the new tasks into a custom email message.
I left the custom alert in place to suppress any daily notifications from the system. I just return 'True' so that alerts are not sent for tasks assigned to only 1 person. I suppose looking back on this, I could have run the query code in the custom alert and not need a separate timer job.

Resources