Bug 293160

Summary: bad programming in smssendprovider "warning: suggest parentheses around assignment used as truth value"
Product: [Unmaintained] kopete Reporter: Philipp Rosenberger <philipp>
Component: SMS PluginAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: andrew.crouthamel
Priority: NOR    
Version First Reported In: SVN   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: faf256370135cb2c63968b38818ec3c38e0abe2c
Sentry Crash Report:

Description Philipp Rosenberger 2012-02-02 17:07:40 UTC
Version:           SVN (using KDE 4.6.4) 
OS:                Linux

The assignment in the ifclause is alwasy true.

	QString message = msg.plainBody();
	QString nr = dynamic_cast<SMSContact 

*>(msg.to().first())->qualifiedNumber();

	if (canSend = false)
		return;

	values[messagePos] = message;
	values[telPos] = nr;

Reproducible: Didn't try

Steps to Reproduce:
compile the source, view the source

Actual Results:  
bad programming

Expected Results:  
better code

this should fix it:
--- protocols/sms/services/smssendprovider.cpp  (revision 1277752)
+++ protocols/sms/services/smssendprovider.cpp  (working copy)
@@ -232,7 +232,7 @@
        QString message = msg.plainBody();
        QString nr = dynamic_cast<SMSContact *>(msg.to().first())->qualifiedNumber();
 
-       if (canSend = false)
+   if (canSend == false)
                return;
 
        values[messagePos] = message;
Comment 1 Andrew Crouthamel 2018-11-06 15:08:33 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!