-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,788 additions
and
1,642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
package xmpp; | ||
|
||
/** | ||
Extension for getting the attention of another user. | ||
Extension for getting the attention of another user. | ||
[XEP-0224: Attention](https://xmpp.org/extensions/xep-0224.html) | ||
[XEP-0224: Attention](https://xmpp.org/extensions/xep-0224.html) | ||
**/ | ||
@xep(224) | ||
class Attention { | ||
|
||
public static inline var XMLNS = "urn:xmpp:attention:0"; | ||
|
||
/** | ||
Sends a message packet to the given entity inluding a property to get attention. | ||
Sends a message packet to the given entity inluding a property to get attention. | ||
**/ | ||
public static inline function captureAttention(message : xmpp.Message) : xmpp.Message { | ||
message.properties.push(XML.create("attention").set('xmlns', XMLNS)); | ||
return message; | ||
public static inline function captureAttention(message:xmpp.Message):xmpp.Message { | ||
message.properties.push(XML.create("attention").set('xmlns', XMLNS)); | ||
return message; | ||
} | ||
|
||
/** | ||
Return `true` if the message stanza includes an `<attention/>` element. | ||
**/ | ||
public static inline function wantsAttention(message : xmpp.Message) : Bool { | ||
return message.properties.filter(e -> return e.is(XMLNS)).length > 0; | ||
} | ||
/** | ||
Return `true` if the message stanza includes an `<attention/>` element. | ||
**/ | ||
public static inline function wantsAttention(message:xmpp.Message):Bool { | ||
return message.properties.filter(e -> return e.is(XMLNS)).length > 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.