| 2933 | | if contact and contact.name: |
| 2934 | | contact_text = '%s (%s)' % (contact.name, contact_jid) |
| 2935 | | else: |
| 2936 | | contact_text = contact_jid |
| 2937 | | pritext = pritext.replace('$Contact', contact_text) |
| 2938 | | |
| 2939 | | label_text = '<big><b>%s</b></big>' % pritext |
| | 2932 | contact_text = contact and contact.name or contact_jid |
| | 2933 | sectext = sectext.replace('$Contact', contact_text) |
| 2943 | | sectext = _('Comment: %s') % comment |
| 2944 | | label_text += '\n\n%s' % sectext |
| 2945 | | |
| 2946 | | xml.get_widget('label').set_markup(label_text) |
| 2947 | | |
| 2948 | | xml.get_widget('deny_button').connect('clicked', |
| 2949 | | self.on_deny_button_clicked) |
| 2950 | | xml.get_widget('accept_button').connect('clicked', |
| 2951 | | self.on_accept_button_clicked) |
| 2952 | | self.dialog.show_all() |
| 2953 | | |
| 2954 | | def on_deny_button_clicked(self, widget): |
| 2955 | | self.dialog.destroy() |
| 2956 | | |
| 2957 | | def on_accept_button_clicked(self, widget): |
| 2958 | | self.dialog.destroy() |
| 2959 | | try: |
| 2960 | | if self.is_continued: |
| 2961 | | gajim.interface.join_gc_room(self.account, self.room_jid, |
| 2962 | | gajim.nicks[self.account], None, is_continued=True) |
| 2963 | | else: |
| 2964 | | JoinGroupchatWindow(self.account, self.room_jid) |
| 2965 | | except GajimGeneralException: |
| 2966 | | pass |
| | 2937 | comment = _('Comment: %s') % comment |
| | 2938 | sectext += '\n\n%s' % comment |
| | 2939 | sectext += '\n\n' + _('Do you want to accept the invitation?') |
| | 2940 | |
| | 2941 | dialog = YesNoDialog(pritext, sectext) |
| | 2942 | if dialog.get_response() == gtk.RESPONSE_YES: |
| | 2943 | try: |
| | 2944 | if self.is_continued: |
| | 2945 | gajim.interface.join_gc_room(self.account, self.room_jid, |
| | 2946 | gajim.nicks[self.account], None, is_continued=True) |
| | 2947 | else: |
| | 2948 | JoinGroupchatWindow(self.account, self.room_jid) |
| | 2949 | except GajimGeneralException: |
| | 2950 | pass |