mirror of
				https://github.com/Mibew/design.git
				synced 2025-10-31 18:41:05 +03:00 
			
		
		
		
	Create JavaScript's Thread class
This commit is contained in:
		
							parent
							
								
									5ff3a7656d
								
							
						
					
					
						commit
						ec5ba068bb
					
				
							
								
								
									
										8
									
								
								src/messenger/webim/js/164/thread.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/messenger/webim/js/164/thread.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,8 @@ | ||||
| /* | ||||
|  This file is part of Mibew Messenger project. | ||||
|  http://mibew.org
 | ||||
| 
 | ||||
|  Copyright (c) 2005-2011 Mibew Messenger Community | ||||
|  License: http://mibew.org/license.php
 | ||||
| */ | ||||
| var Thread=function(a){this.threadid=a.threadid||0;this.token=a.token||0;this.lastid=a.lastid||0;this.user=a.user||!1};Thread.prototype.KIND_USER=1;Thread.prototype.KIND_AGENT=2;Thread.prototype.KIND_FOR_AGENT=3;Thread.prototype.KIND_INFO=4;Thread.prototype.KIND_CONN=5;Thread.prototype.KIND_EVENTS=6;Thread.prototype.KIND_AVATAR=7; | ||||
							
								
								
									
										75
									
								
								src/messenger/webim/js/source/thread.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										75
									
								
								src/messenger/webim/js/source/thread.js
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,75 @@ | ||||
| /** | ||||
|  * @preserve This file is part of Mibew Messenger project. | ||||
|  * http://mibew.org
 | ||||
|  * | ||||
|  * Copyright (c) 2005-2011 Mibew Messenger Community | ||||
|  * License: http://mibew.org/license.php
 | ||||
|  */ | ||||
| 
 | ||||
| /** | ||||
|  * Create an instance of thread | ||||
|  * @constructor | ||||
|  */ | ||||
| var Thread = function(options) { | ||||
| 
 | ||||
|     /** | ||||
|      * Id of the thread | ||||
|      * @type Number | ||||
|      */ | ||||
|     this.threadid = options.threadid || 0; | ||||
| 
 | ||||
|     /** | ||||
|      * Thread's token. Uses for verify thread | ||||
|      * @type Number | ||||
|      */ | ||||
|     this.token = options.token || 0; | ||||
| 
 | ||||
|     /** | ||||
|      * Last message id received by the thread | ||||
|      * @type Number | ||||
|      */ | ||||
|     this.lastid = options.lastid || 0; | ||||
| 
 | ||||
|     /** | ||||
|      * Indicates if thread dispalys for user or for agent. | ||||
|      * | ||||
|      * Boolean true stands for user and boolean false stands for agent. | ||||
|      * @type Boolean | ||||
|      */ | ||||
|     this.user = options.user || false; | ||||
| } | ||||
| 
 | ||||
| /** Message kinds section */ | ||||
| 
 | ||||
| /** | ||||
|  * Message sent by user | ||||
|  */ | ||||
| Thread.prototype.KIND_USER = 1; | ||||
| /** | ||||
|  * Message sent by operator | ||||
|  */ | ||||
| Thread.prototype.KIND_AGENT = 2; | ||||
| /** | ||||
|  * Hidden system message to operator | ||||
|  */ | ||||
| Thread.prototype.KIND_FOR_AGENT = 3; | ||||
| /** | ||||
|  * System messages for user and operator | ||||
|  */ | ||||
| Thread.prototype.KIND_INFO = 4; | ||||
| /** | ||||
|  * Message for user if operator have connection problems | ||||
|  */ | ||||
| Thread.prototype.KIND_CONN = 5; | ||||
| /** | ||||
|  * System message about some events (like rename). | ||||
|  */ | ||||
| Thread.prototype.KIND_EVENTS = 6; | ||||
| /** | ||||
|  * Message with operators avatar | ||||
|  * | ||||
|  * This kind of message leaved only for compatibility with core | ||||
|  */ | ||||
| Thread.prototype.KIND_AVATAR = 7; | ||||
| 
 | ||||
| /** End of Message kinds section */ | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user