Members
Methods
checkTagUniqueness(tag, caller) → {Promise}
Check if the given tag is unique by asking the server.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
string
|
tag to check. |
caller |
string
|
identifier of the caller. |
Returns:
- Type:
-
Promise
promise to be resolved with true if the tag is unique, false otherwise.
initDatabase() → {Promise}
Initialize persistent cache: open or create/upgrade if needed.
Returns:
- Type:
-
Promise
promise to be resolved/rejected when the DB is initialized.
isChannelTopicName(name) → {boolean}
Check if the topic name is a name of a channel.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
topic name to check. |
Returns:
- Type:
-
boolean
true if the name is a name of a channel, false otherwise.
isCommTopicName(name) → {boolean}
Check if the given topic name is a name of a communication topic, i.e. P2P or group.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
Name of the topic to test. |
Returns:
- Type:
-
boolean
true if the name is a name of a p2p or group topic, false otherwise.
isEmpty() → {boolean}
Check if buffer is empty.
- Source:
Returns:
- Type:
-
boolean
true if the buffer is empty, false otherwise.
isGroupTopicName(name) → {boolean}
Check if the given topic name is a name of a group topic.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
Name of the topic to test. |
Returns:
- Type:
-
boolean
true if the name is a name of a group topic, false otherwise.
isMeTopicName(name) → {boolean}
Check if the given topic name is a name of a 'me' topic.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
Name of the topic to test. |
Returns:
- Type:
-
boolean
true if the name is a name of a 'me' topic, false otherwise.
isNewGroupTopicName(name) → {boolean}
Check if the topic name is a name of a new topic.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
topic name to check. |
Returns:
- Type:
-
boolean
true if the name is a name of a new topic, false otherwise.
isP2PTopicName(name) → {boolean}
Check if the given topic name is a name of a p2p topic.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
Name of the topic to test. |
Returns:
- Type:
-
boolean
true if the name is a name of a p2p topic, false otherwise.
isSelfTopicName(name) → {boolean}
Check if the given topic name is a name of a 'slf' topic.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
Name of the topic to test. |
Returns:
- Type:
-
boolean
true if the name is a name of a 'slf' topic, false otherwise.
isSubscribed() → {boolean}
Check if the topic is subscribed.
Returns:
- Type:
-
boolean
True is topic is attached/subscribed, false otherwise.
maxDelId(topicName) → {Promise}
Retrieve the latest 'clear' ID for the given topic.
Parameters:
| Name | Type | Description |
|---|---|---|
topicName |
string
|
Returns:
- Type:
-
Promise
promise resolved/rejected on operation completion.
merge(that)
Merge another card into this one.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
that |
Object
|
Card object to merge. |
subscribe(getParamsopt, setParamsopt) → {Promise}
Request topic to subscribe. Wrapper for Tinode#subscribe.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
getParams |
Tinode.GetQuery
|
<optional> |
get query parameters. |
setParams |
Tinode.SetParams
|
<optional> |
set parameters. |
Returns:
- Type:
-
Promise
Promise to be resolved/rejected when the server responds to the request.
topicType(name) → {string}
Determine topic type from topic's name: grp, p2p, me, fnd, sys.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string
|
Name of the topic to test. |
Returns:
- Type:
-
string
One of
"me", "fnd", "sys", "grp",
"p2p" or undefined.
Type Definitions
contactFilter(contact) → {boolean}
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
contact |
Object
|
contact to check for inclusion. |
Returns:
- Type:
-
boolean
true if contact should be processed, false to exclude it.