Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:comet:javascript_api [2018/02/17 02:20]
anastation468 [Sending messages to channel from JS (pipes web_*)]
en:comet:javascript_api [2019/12/18 02:05] (current)
Line 133: Line 133:
 </​code>​ </​code>​
  
-Field server_info.user_id in incoming message fills out by some information besides zero just if message was sent to channel from JavaScript API and sender was authorized on comet server. Also it contains sender’s user_id.+Field server_info.user_id in incoming message fills out by some information besides zero just if message was sent to channel from JavaScript API and sender was authorized on comet server. Alsoit contains sender’s user_id.
 ====== Getting the last messages from channel ====== ====== Getting the last messages from channel ======
-The comet server includes possibility to activate ​storing the last N messages mechanism for some channels.+The comet server includes possibility to activated ​storing the last N messages mechanism for some channels.
 <note tip>​Logging of transferred messages may be activate by CometQL query to table “[[en:​comet:​cometql|pipes_settings]]”.</​note> ​ <note tip>​Logging of transferred messages may be activate by CometQL query to table “[[en:​comet:​cometql|pipes_settings]]”.</​note> ​
  
Line 144: Line 144:
 ======= Getting a number of subscribers ======= ======= Getting a number of subscribers =======
  
-The function “count_user_in_pipe” can helps to determine a number of subscribes for current channel.+The function “count_user_in_pipe” can help to determine a number of subscribes for current channel.
  
-Also this function has the first argument – name of channel and the second is callback function which holds an answer.+Alsothis function has the first argument – name of channel and the second is callback function which holds an answer.
 <code Javascript>​ <code Javascript>​
 cometApi.count_users_in_pipe("​web_chat_pipe",​ function(res) cometApi.count_users_in_pipe("​web_chat_pipe",​ function(res)
Line 176: Line 176:
 These functions will be called when authorization status will be changing. I.e. at least once an authorization will be successful or unsuccessful when connecting to comet server or while status will be changed. ​ These functions will be called when authorization status will be changing. I.e. at least once an authorization will be successful or unsuccessful when connecting to comet server or while status will be changed. ​
  
-Also you can call the function “isAuthorized” to determine authorization status.+You can also call the function “isAuthorized” to determine authorization status.
 <code JavaScript>​cometApi.isAuthorized()</​code>​ <code JavaScript>​cometApi.isAuthorized()</​code>​
 The function “isAuthorized” may return 3 different values: ​ The function “isAuthorized” may return 3 different values: ​