Skip to content

Commit

Permalink
Merge pull request #2 from Dykam/grouppresence
Browse files Browse the repository at this point in the history
Make it possible to retrieve the room which spawned GroupPresenceEventArgs
  • Loading branch information
stevenlivz authored Feb 8, 2018
2 parents b2e0ae8 + d7dc0ea commit 0a5156b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Extensions/XEP-0045/GroupPresenceEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class GroupPresenceEventArgs : EventArgs
/// </summary>
public Occupant Person { get; set; }

public Jid Group { get; }

/// <summary>
///
/// </summary>
Expand All @@ -22,10 +24,12 @@ public class GroupPresenceEventArgs : EventArgs
///
/// </summary>
/// <param name="person"></param>
/// <param name="group"></param>
/// <param name="statuses"></param>
public GroupPresenceEventArgs(Occupant person, IEnumerable<MucStatusType> statuses) : base()
public GroupPresenceEventArgs(Occupant person, Jid group, IEnumerable<MucStatusType> statuses) : base()
{
Person = person;
Group = group;
Statuses = statuses;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Extensions/XEP-0045/MultiUserChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public bool Input (Im.Presence stanza)
bool hasNoAvailability = string.IsNullOrWhiteSpace(stanza.Data["show"]?.InnerText);

if (person != null) {
PrescenceChanged.Raise (this, new GroupPresenceEventArgs (person, statusCodeList));
PrescenceChanged.Raise (this, new GroupPresenceEventArgs (person, new Jid(stanza.From.Domain, stanza.From.Node), statusCodeList));
return hasNoAvailability;
}
}
Expand Down

0 comments on commit 0a5156b

Please sign in to comment.