mirror of
				https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
				synced 2025-11-04 04:12:45 +00:00 
			
		
		
		
	Better comments
This commit is contained in:
		@@ -69,7 +69,7 @@ def user_data_stream(app, user_id, session_id, foreign=False):
 | 
				
			|||||||
        # Gather current values from database.
 | 
					        # Gather current values from database.
 | 
				
			||||||
        user = User.query.get(user_id)
 | 
					        user = User.query.get(user_id)
 | 
				
			||||||
        user_dict = user.to_dict()
 | 
					        user_dict = user.to_dict()
 | 
				
			||||||
        # Send initial values to the user.
 | 
					        # Send initial values to the client.
 | 
				
			||||||
        socketio.emit(init_event, json.dumps(user_dict), room=session_id)
 | 
					        socketio.emit(init_event, json.dumps(user_dict), room=session_id)
 | 
				
			||||||
        while session_id in connected_sessions:
 | 
					        while session_id in connected_sessions:
 | 
				
			||||||
            # Get new values from the database
 | 
					            # Get new values from the database
 | 
				
			||||||
@@ -78,7 +78,7 @@ def user_data_stream(app, user_id, session_id, foreign=False):
 | 
				
			|||||||
            # Compute JSON patches.
 | 
					            # Compute JSON patches.
 | 
				
			||||||
            user_patch = jsonpatch.JsonPatch.from_diff(user_dict,
 | 
					            user_patch = jsonpatch.JsonPatch.from_diff(user_dict,
 | 
				
			||||||
                                                       new_user_dict)
 | 
					                                                       new_user_dict)
 | 
				
			||||||
            # In case there are patches, send them to the user.
 | 
					            # In case there are patches, send them to the client.
 | 
				
			||||||
            if user_patch:
 | 
					            if user_patch:
 | 
				
			||||||
                socketio.emit(update_event, user_patch.to_string(),
 | 
					                socketio.emit(update_event, user_patch.to_string(),
 | 
				
			||||||
                              room=session_id)
 | 
					                              room=session_id)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user