Skip to content

Commit 0a5156b

Browse files
authored
Merge pull request #2 from Dykam/grouppresence
Make it possible to retrieve the room which spawned GroupPresenceEventArgs
2 parents b2e0ae8 + d7dc0ea commit 0a5156b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Extensions/XEP-0045/GroupPresenceEventArgs.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public class GroupPresenceEventArgs : EventArgs
1313
/// </summary>
1414
public Occupant Person { get; set; }
1515

16+
public Jid Group { get; }
17+
1618
/// <summary>
1719
///
1820
/// </summary>
@@ -22,10 +24,12 @@ public class GroupPresenceEventArgs : EventArgs
2224
///
2325
/// </summary>
2426
/// <param name="person"></param>
27+
/// <param name="group"></param>
2528
/// <param name="statuses"></param>
26-
public GroupPresenceEventArgs(Occupant person, IEnumerable<MucStatusType> statuses) : base()
29+
public GroupPresenceEventArgs(Occupant person, Jid group, IEnumerable<MucStatusType> statuses) : base()
2730
{
2831
Person = person;
32+
Group = group;
2933
Statuses = statuses;
3034
}
3135
}

Extensions/XEP-0045/MultiUserChat.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public bool Input (Im.Presence stanza)
172172
bool hasNoAvailability = string.IsNullOrWhiteSpace(stanza.Data["show"]?.InnerText);
173173

174174
if (person != null) {
175-
PrescenceChanged.Raise (this, new GroupPresenceEventArgs (person, statusCodeList));
175+
PrescenceChanged.Raise (this, new GroupPresenceEventArgs (person, new Jid(stanza.From.Domain, stanza.From.Node), statusCodeList));
176176
return hasNoAvailability;
177177
}
178178
}

0 commit comments

Comments
 (0)