| 
									
										
										
										
											2019-07-13 05:39:01 -04:00
										 |  |  | import QtQuick 2.12 | 
					
						
							| 
									
										
										
										
											2019-04-28 15:18:36 -04:00
										 |  |  | import "../../Base" | 
					
						
							| 
									
										
										
										
											2019-04-21 15:20:20 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | Banner { | 
					
						
							| 
									
										
										
										
											2019-12-09 05:25:31 -04:00
										 |  |  |     property string inviterId: chat.roomInfo.inviter | 
					
						
							|  |  |  |     property string inviterName: chat.roomInfo.inviter_name | 
					
						
							|  |  |  |     property string inviterAvatar: chat.roomInfo.inviter_avatar | 
					
						
							| 
									
										
										
										
											2019-04-21 15:20:20 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-06 17:50:55 -04:00
										 |  |  |     color: theme.chat.inviteBanner.background | 
					
						
							| 
									
										
										
										
											2019-04-28 11:01:38 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-07 00:24:23 -04:00
										 |  |  |     avatar.userId: inviterId | 
					
						
							| 
									
										
										
										
											2019-08-15 12:13:41 -04:00
										 |  |  |     avatar.displayName: inviterName | 
					
						
							| 
									
										
										
										
											2019-11-03 13:48:12 -04:00
										 |  |  |     avatar.mxc: inviterAvatar | 
					
						
							| 
									
										
										
										
											2019-04-21 15:20:20 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-04 09:32:07 -04:00
										 |  |  |     labelText: qsTr("%1 invited you to this room").arg( | 
					
						
							| 
									
										
										
										
											2019-12-17 17:59:53 -04:00
										 |  |  |         utils.coloredNameHtml(inviterName, inviterId) | 
					
						
							| 
									
										
										
										
											2019-07-05 16:48:30 -04:00
										 |  |  |     ) | 
					
						
							| 
									
										
										
										
											2019-04-21 15:20:20 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     buttonModel: [ | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2019-04-28 14:20:30 -04:00
										 |  |  |             name: "accept", | 
					
						
							| 
									
										
										
										
											2019-08-15 12:13:41 -04:00
										 |  |  |             text: qsTr("Join"), | 
					
						
							| 
									
										
										
										
											2019-07-18 04:23:23 -04:00
										 |  |  |             iconName: "invite-accept", | 
					
						
							| 
									
										
										
										
											2019-08-28 18:21:13 -04:00
										 |  |  |             iconColor: theme.colors.positiveBackground | 
					
						
							| 
									
										
										
										
											2019-04-21 15:20:20 -04:00
										 |  |  |         }, | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2019-04-28 14:20:30 -04:00
										 |  |  |             name: "decline", | 
					
						
							|  |  |  |             text: qsTr("Decline"), | 
					
						
							| 
									
										
										
										
											2019-07-18 04:23:23 -04:00
										 |  |  |             iconName: "invite-decline", | 
					
						
							| 
									
										
										
										
											2019-08-28 18:21:13 -04:00
										 |  |  |             iconColor: theme.colors.negativeBackground | 
					
						
							| 
									
										
										
										
											2019-04-21 15:20:20 -04:00
										 |  |  |         } | 
					
						
							|  |  |  |     ] | 
					
						
							| 
									
										
										
										
											2019-04-28 14:20:30 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-18 04:17:35 -04:00
										 |  |  |     buttonCallbacks: ({ | 
					
						
							|  |  |  |         accept: button => { | 
					
						
							| 
									
										
										
										
											2019-04-28 14:20:30 -04:00
										 |  |  |             button.loading = true | 
					
						
							| 
									
										
										
										
											2019-07-05 16:48:30 -04:00
										 |  |  |             py.callClientCoro( | 
					
						
							| 
									
										
										
										
											2019-12-09 05:25:31 -04:00
										 |  |  |                 chat.userId, "join", [chat.roomId], () => { | 
					
						
							| 
									
										
										
										
											2019-07-07 23:38:37 -04:00
										 |  |  |                     button.loading = false | 
					
						
							|  |  |  |             }) | 
					
						
							| 
									
										
										
										
											2019-04-28 14:20:30 -04:00
										 |  |  |         }, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-18 04:17:35 -04:00
										 |  |  |         decline: button => { | 
					
						
							| 
									
										
										
										
											2019-04-28 14:20:30 -04:00
										 |  |  |             button.loading = true | 
					
						
							| 
									
										
										
										
											2019-07-05 16:48:30 -04:00
										 |  |  |             py.callClientCoro( | 
					
						
							| 
									
										
										
										
											2019-12-09 05:25:31 -04:00
										 |  |  |                 chat.userId, "room_leave", [chat.roomId], () => { | 
					
						
							| 
									
										
										
										
											2019-07-07 23:38:37 -04:00
										 |  |  |                     button.loading = false | 
					
						
							|  |  |  |             }) | 
					
						
							| 
									
										
										
										
											2019-04-28 14:20:30 -04:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2019-07-18 04:17:35 -04:00
										 |  |  |     }) | 
					
						
							| 
									
										
										
										
											2019-04-21 15:20:20 -04:00
										 |  |  | } |