mirror of
				https://github.com/matrix-org/gomatrix
				synced 2025-10-31 20:38:07 +00:00 
			
		
		
		
	Add helper function to find single stage flows
This commit is contained in:
		
							parent
							
								
									831dfd27a6
								
							
						
					
					
						commit
						09b6649b47
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		
							
								
								
									
										10
									
								
								responses.go
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								responses.go
									
										
									
									
									
								
							|  | @ -47,6 +47,16 @@ type RespUserInteractive struct { | |||
| 	Error     string                 `json:"error"` | ||||
| } | ||||
| 
 | ||||
| // HasSingleStageFlow returns true if there exists at least 1 Flow with a single stage of stageName. | ||||
| func (r RespUserInteractive) HasSingleStageFlow(stageName string) bool { | ||||
| 	for _, f := range r.Flows { | ||||
| 		if len(f.Stages) == 1 && f.Stages[0] == stageName { | ||||
| 			return true | ||||
| 		} | ||||
| 	} | ||||
| 	return false | ||||
| } | ||||
| 
 | ||||
| // RespRegister is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register | ||||
| type RespRegister struct { | ||||
| 	AccessToken  string `json:"access_token"` | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue