| 172 | | jid_id = self.cur.fetchone()[0] |
| 173 | | else: # oh! a new jid :), we add it now |
| 174 | | if typestr == 'ROOM': |
| 175 | | typ = constants.JID_ROOM_TYPE |
| 176 | | else: |
| 177 | | typ = constants.JID_NORMAL_TYPE |
| 178 | | self.cur.execute('INSERT INTO jids (jid, type) VALUES (?, ?)', (jid, typ)) |
| 179 | | try: |
| 180 | | self.con.commit() |
| 181 | | except sqlite.OperationalError, e: |
| 182 | | print >> sys.stderr, str(e) |
| 183 | | jid_id = self.cur.lastrowid |
| 184 | | self.jids_already_in.append(jid) |
| | 172 | row = self.cur.fetchone() |
| | 173 | if row: |
| | 174 | return row[0] |
| | 175 | # oh! a new jid :), we add it now |
| | 176 | if typestr == 'ROOM': |
| | 177 | typ = constants.JID_ROOM_TYPE |
| | 178 | else: |
| | 179 | typ = constants.JID_NORMAL_TYPE |
| | 180 | self.cur.execute('INSERT INTO jids (jid, type) VALUES (?, ?)', (jid, typ)) |
| | 181 | try: |
| | 182 | self.con.commit() |
| | 183 | except sqlite.OperationalError, e: |
| | 184 | print >> sys.stderr, str(e) |
| | 185 | jid_id = self.cur.lastrowid |
| | 186 | self.jids_already_in.append(jid) |