Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LXMessage SetX functions (was: SetSource/Destination) not functioning as intended #16

Closed
faragher opened this issue Jan 14, 2024 · 3 comments

Comments

@faragher
Copy link

When attempting to set a message's source or destination, for example (L is an LXMessage):

  L.set_destination(lxmf_destination)
  L.set_source(self.server_lxmf_delivery)

then attempting to use handle_outbound(L) results in the following:

  [Error] Error occurred while handling request. The contained exception was: 'LXMessage' object has no attribute 'destination'

Setting them improperly, eg:

  L.destination = lxmf_destination
  L.source = self.server_lxmf_delivery

avoids this error (but fails elsewhere with a nonetype not having hash). It seems likely this is related to the destination vs __destination discussion I saw elsewhere.

Is this an issue with a rarely used function or am I missing a step? It won't send or pack and the way the exceptions are wrapped means I'll have to walk through the code to find the specific error line or further troubleshoot.

@faragher
Copy link
Author

Similar, likely related strangeness:

     LN = LXMF.LXMessage(
        lxmf_destination, 
        self.server_lxmf_delivery, 
        "",  
        fields = L.fields,
        desired_method=LXMF.LXMessage.DIRECT
      )
      print(L.content)
      print(L.title)
      LN.set_content_from_bytes = L.content
      LN.set_title_from_bytes = L.title
      LN.pack()
      print(LN.content)
      print(LN.title)

results in:

b'This is a POPR test message'
b'Hello, there'
b''
b''

Removing the pack() call results in the same. Message sends properly but does not contain any title or content. Looking at LXMessage, I'm not sure why this doesn't seem to work. The packing doesn't raise an error, so it doesn't appear to be already packed.

@faragher
Copy link
Author

      LN.content = L.content
      LN.title = L.title

successfully transfers the data and sends correctly.

@faragher faragher changed the title SetSource/Destination not functioning as intended LXMessage SetX functions (was: SetSource/Destination) not functioning as intended Jan 14, 2024
@markqvist
Copy link
Owner

Confirmed, there is an inconsistency here because a @property was not properly declared. Thanks for finding and reporting it! Will have it fixed shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants