implement /me functionality and cleanup :p
This commit is contained in:
		
							parent
							
								
									2b6cc45e69
								
							
						
					
					
						commit
						446dcc49a0
					
				
					 1 changed files with 24 additions and 11 deletions
				
			
		| 
						 | 
					@ -194,18 +194,31 @@ class message_Window:
 | 
				
			||||||
		if not tim:
 | 
							if not tim:
 | 
				
			||||||
			tim = time.localtime()
 | 
								tim = time.localtime()
 | 
				
			||||||
		tims = time.strftime("[%H:%M:%S]", tim)
 | 
							tims = time.strftime("[%H:%M:%S]", tim)
 | 
				
			||||||
		buffer.insert(end_iter, tims)
 | 
							buffer.insert(end_iter, tims + ' ')
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							otxt = ''
 | 
				
			||||||
 | 
							ttxt = ''
 | 
				
			||||||
 | 
							if contact and contact == 'status':
 | 
				
			||||||
 | 
								tag = 'status'
 | 
				
			||||||
 | 
								ttxt = txt + '\n'
 | 
				
			||||||
 | 
							else:
 | 
				
			||||||
			if contact:
 | 
								if contact:
 | 
				
			||||||
			if contact == 'status':
 | 
									tag = 'outgoing'
 | 
				
			||||||
				buffer.insert_with_tags_by_name(end_iter, txt+'\n', \
 | 
									name = self.plugin.nicks[self.account] 
 | 
				
			||||||
					'status')
 | 
					 | 
				
			||||||
			else:
 | 
								else:
 | 
				
			||||||
				buffer.insert_with_tags_by_name(end_iter, '<'+self.plugin.nicks[self.account]+'> ', 'outgoing')
 | 
									tag = 'incoming'
 | 
				
			||||||
				buffer.insert(end_iter, txt+'\n')
 | 
									name = self.user.name
 | 
				
			||||||
 | 
									
 | 
				
			||||||
 | 
								if string.find(txt, '/me ') == 0:
 | 
				
			||||||
 | 
									ttxt = name + ' ' + txt[4:] + '\n'
 | 
				
			||||||
			else:
 | 
								else:
 | 
				
			||||||
			buffer.insert_with_tags_by_name(end_iter, '<' + \
 | 
									ttxt = '<' + name + '> '
 | 
				
			||||||
				self.user.name + '> ', 'incoming')
 | 
									otxt = txt + '\n'
 | 
				
			||||||
			buffer.insert(end_iter, txt+'\n')
 | 
					
 | 
				
			||||||
 | 
							buffer.insert_with_tags_by_name(end_iter, ttxt, tag)
 | 
				
			||||||
 | 
							if len(otxt) > 0:
 | 
				
			||||||
 | 
								buffer.insert(end_iter, otxt)
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		#scroll to the end of the textview
 | 
							#scroll to the end of the textview
 | 
				
			||||||
		conversation.scroll_to_mark(buffer.get_mark('end'), 0.1, 0, 0, 0)
 | 
							conversation.scroll_to_mark(buffer.get_mark('end'), 0.1, 0, 0, 0)
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue