~vomun-developers/anonplus/vomun-trunk

« back to all changes in this revision

Viewing changes to src/libs/friends.py

  • Committer: AJ00200
  • Date: 2011-11-05 20:49:21 UTC
  • Revision ID: git-v1:7dea85d601899d3d318cbf63da6fb81bbbe3e33a
Added the ability to send messages, syncing with other computer

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
        self.wconnection = None
76
76
        self.data = ''
77
77
        
 
78
        print('Setting up encryption. %s:%s' % (
 
79
                libs.globals.global_vars['config']['nodekey'], self.keyid)
78
80
        self.encryption = libs.encryption.gpg.Encryption(
79
81
                libs.globals.global_vars['config']['nodekey'], self.keyid)
80
82
 
134
136
        if not self.connected and not system:
135
137
            print 'not connected: Message discarded. Message was: %s' % message
136
138
            return
137
 
        self.wconnection.send(self.encryption.encrypt(data))
 
139
        message = self.encryption.encrypt(data)
 
140
        print('Encrypted: %s' % message)
 
141
        self.wconnection.send(message)
138
142
 
139
 
    def send_message(self,message):
 
143
    def send_message(self, message):
140
144
        '''Sends a Text message to a friend'''
141
145
        keyid = self.keyid
142
146
        keyidlength = len(keyid)