do some check before adding a contact

This commit is contained in:
Yann Leboulanger 2004-11-18 19:22:33 +00:00
parent cb7e5396df
commit fcee8b2afd
1 changed files with 5 additions and 0 deletions

View File

@ -333,6 +333,11 @@ class addContact_Window:
textview_sub = self.xml.get_widget("textview_sub") textview_sub = self.xml.get_widget("textview_sub")
entry_who = self.xml.get_widget('entry_who') entry_who = self.xml.get_widget('entry_who')
who = entry_who.get_text() who = entry_who.get_text()
if not who:
return
if who.find('@') < 0:
warning_Window(_("The contact's name must be something like login@hostname"))
return
buf = textview_sub.get_buffer() buf = textview_sub.get_buffer()
start_iter = buf.get_start_iter() start_iter = buf.get_start_iter()
end_iter = buf.get_end_iter() end_iter = buf.get_end_iter()