Code Duplication    Length = 12-15 lines in 2 locations

chat/tornado/message_handler.py 2 locations

@@ 361-375 (lines=15) @@
358
			def edit_glyphy(message, giphy):
359
				do_db(selector.update, content=message.content, symbol=message.symbol, giphy=giphy)
360
				message.giphy = giphy
361
				self.publish(self.create_send_message(message, Actions.EDIT_MESSAGE, None), message.room_id)
362
			self.search_giphy(message, giphy_match, edit_glyphy)
363
			return
364
		else:
365
			action = Actions.EDIT_MESSAGE
366
			message.giphy = None
367
			prep_imgs = process_images(data.get(VarNames.IMG), message)
368
			selector.update(content=message.content, symbol=message.symbol, giphy=None)
369
		self.publish(self.create_send_message(message, action, prep_imgs), message.room_id)
370
371
	def send_client_new_channel(self, message):
372
		room_id = message[VarNames.ROOM_ID]
373
		self.add_channel(room_id)
374
		self.add_online_user(room_id)
375
376
	def send_client_delete_channel(self, message):
377
		room_id = message[VarNames.ROOM_ID]
378
		self.async_redis.unsubscribe((room_id,))
@@ 459-470 (lines=12) @@
456
		if sender_ws_status == WebRtcRedisStates.READY and self_ws_status == WebRtcRedisStates.OFFERED:
457
			self.async_redis_publisher.hset(connection_id, self.id, WebRtcRedisStates.RESPONDED)
458
			self.publish(self.reply_webrtc(
459
				Actions.REPLY_FILE_CONNECTION,
460
				connection_id,
461
				HandlerNames.WEBRTC_TRANSFER,
462
				in_message[VarNames.CONTENT]
463
			), sender_ws_id)
464
		else:
465
			raise ValidationError("Invalid channel status.")
466
467
	def reply_call_connection(self, in_message):
468
		self.send_call_answer(
469
			in_message,
470
			WebRtcRedisStates.RESPONDED,
471
			Actions.REPLY_CALL_CONNECTION,
472
			[WebRtcRedisStates.OFFERED],
473
			HandlerNames.WEBRTC_TRANSFER